Hi all,
How to implement the export of PowerPoint presentation to video in mp4 format using apple script?
The following script generates a video file, but the size is 0 bytes. How to fix it?
tell active presentation save in saveDocument as save as movie end tell
PowerPoint presentations have a save as movie settings property which (theoretically) defines the output format (e.g. frame width/height, soundtrack, etc.)
I can imagine that if this data is undefined (the default), then you get an empty video file.
The solution probably hinges around setting these values prior to trying to export your presentation.
I took a stab at it, but it’s MS, and don’t have enough spare goats to sacrifice to get a working script. YMMV.
I had a look too. In the UI movies are exported, not saved, and there doesn’t seem to be an export command in the dictionary.
You may experiment using the movie file formats as they appear in the export command (“MP4”, “MOV”).
save reference ¬
in file ¬
as saveable file format
I was able to create a movie file and save it, but couldn’t make it play.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set movieFile to choose file name with prompt ¬
"Enter file Name" default name ¬
"movieFile.MP4" default location path to desktop
try
set openFile to open for access movieFile with write permission
on error errMsg number errNum
close access myFile
set openFile to open for access myFile with write permission
end try
close access openFile
tell application "Microsoft PowerPoint"
save active presentation ¬
in movieFile ¬
as "MP4"
end tell