AppleScript Keynote export bug?

I’m trying to export a keynote to a QuickTime movie and I’m hitting a weird snag.

I want to export to either a medium or large format (based on the values in the dictionary and from https://macosxautomation.com/applescript/iwork/keynote/document-export.html#export-movie).

However, both medium and large automatically change to 360p or 720p in the editor and then gives me a syntax error on the identifier.

I’ve recorded a short video to demonstrate.

Is this a bug or is my code wrong?

Here’s the code that fails:

tell application "Keynote"
    activate
    set fileName to (path to movies folder as string) & "test.m4v"
    export front document to fileName as QuickTime movie with properties {movie format:720p}
end tell

Here’s a video of what’s happening:

Info:
High Sierra - 10.13.6
Keynote version 8.1 (5683)

I hate to ask, but did you try wrapping the 720p in quotation marks? The following compiles for me:

tell application "Keynote"
	activate
	set fileName to (path to movies folder as string) & "test.m4v"
	export front document to fileName as QuickTime movie with properties {movie format:"720p"}
end tell

Yeah, the issue is that it compiles, but it still doesn’t run. :frowning:

3800 3800

Shouldn’t this be

set fileName to ((path to movies folder as string) & "test.m4v") as file

Not that that solves the error though.

Well, I solved the issue by just removing the “with properties…” clause.

I think it is an AppleScript bug, but not a full deal breaker. /shrug

Going to add a couple more features to the rest of the script and then I’ll post it up for others.

2 Likes