Skip to content

Instantly share code, notes, and snippets.

@timothyekl
Created May 28, 2013 14:33
Show Gist options
  • Save timothyekl/5663182 to your computer and use it in GitHub Desktop.
Save timothyekl/5663182 to your computer and use it in GitHub Desktop.
Convert Keynote 5.3 documents to PDF
on run
display dialog "Drag keynote documents on me to convert to PDF."
end run
on open draggeditems
repeat with thisFile in draggeditems as list
tell application "Finder" to reveal item thisFile
set thisFile to thisFile as alias
tell application "Keynote" to open thisFile
tell application "System Events"
tell application process "Keynote"
set frontmost to true
click menu item "PDF…" of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
repeat until sheet 1 of window 1 exists
delay 1
end repeat
tell sheet 1 of window 1
click radio button "Slides" of radio group 1
click checkbox "Print each stage of builds"
click checkbox "Include date"
click button "Next…"
end tell
repeat until button "Export" of sheet 1 of window 1 exists
delay 1
end repeat
tell sheet 1 of window 1
click button "Export"
end tell
delay 3
keystroke "w" using command down
end tell
end tell
end repeat
end open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment