Last active
September 9, 2020 22:02
-
-
Save chatchavan/241c943880247f87660ffac54e006392 to your computer and use it in GitHub Desktop.
AppleScript for using Keynote PNG exports with in video editing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Export the Keynote presentation of the front window to a folder on the desktop as PNG | |
tell application "Finder" | |
set folderName to "Keynote export" | |
set folderPath to POSIX path of (path to desktop) & folderName | |
-- trash the previous export, if any | |
if ((exists folder (folderName) of desktop)) then | |
move my (POSIX file folderPath) to the trash | |
end if | |
-- make a new folder | |
make new folder at desktop with properties {name:folderName} | |
-- export | |
tell application "Keynote" | |
tell front document | |
export as slide images to POSIX file folderPath with properties {image format:PNG} | |
end tell | |
end tell | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Make Finder select the corresponding PNG of the current slide | |
-- get the slide number | |
tell application "Keynote" | |
tell document 1 | |
set slideNumber to slide number of the current slide | |
end tell | |
end tell | |
-- compose the path name | |
set slideFileName to text -3 thru -1 of ("000" & slideNumber) | |
set slideFilePath to POSIX path of (path to desktop) & "Keynote export/" & slideFileName & ".png" | |
log slideFilePath | |
-- select the path | |
tell application "Finder" | |
select my (POSIX file slideFilePath) | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment