I use Keynote for creating graphics for various purposes, and I've found myself frustrated by the number of manual steps needed to export a single slide as a PNG image. I was pointed to Keyboard Maestro as a possible solution. What I am trying to do is create an action that will:
Open the Export Image menu: File -> Export To -> Images...
Choose the "From" option and enter the slide number in both the "From" and "to" fields
Choose the "PNG" format
Click Next
Enter a filename that includes the slide number (otherwise you get a warning about overwriting the last time you exported)
Click Export
I can't seem to figure out how to select the specific fields in this export menu, I don't want to do it with cursor position offsets since that seems unreliable. Any help is appreciated!
Use the Type a Keystroke action to Tab in to the field, and then Insert Text by Typing action to type the number, and then another Tab and repeat the number.
Click on the menu. As above, choose either an image like:
tell application "Keynote"
set doc to open "/Users/me/Dropbox/Presentations 2017/filename.key"
tell the front document
set skipped of every slide to true
set skipped of slide 1 to false
end tell
export doc as slide images to "/Users/me/Desktop/folder" with properties {image format:JPEG, compression factor:0.9}
tell the front document
set skipped of every slide to false
end tell
close saving yes
end tell
This exports to JPEG instead of PNG, but that should be easy enough to change.
Thanks, this is amazing! I didn't realize it could do image matching to establish a reference point!
I ended up using a pure AppleScript solution for this, but it requires setting all but the current slide to "skipped" and then setting them all back to "unskipped", whereas this solution would avoid that problem! I will come back to this if that ends up being a problem for me. Thanks!