Skip to content

Instantly share code, notes, and snippets.

@boillodmanuel
Last active November 18, 2022 20:32
Show Gist options
  • Save boillodmanuel/1f4b94f0410081338a98935f13c557da to your computer and use it in GitHub Desktop.
Save boillodmanuel/1f4b94f0410081338a98935f13c557da to your computer and use it in GitHub Desktop.
How to print full presenter notes without slides in Keynote - Answer to https://apple.stackexchange.com/questions/136118/how-to-print-full-presenter-notes-without-slides-in-keynote
global presenterNotes
tell application "Keynote"
activate
open (choose file)
tell front document
do shell script "rm -f ~/keynote-notes.txt"
set num to 0
repeat with aSlide in every slide
set num to num + 1
do shell script "echo '-- " & num & " --' >> ~/keynote-notes.txt"
set slideNote to presenter notes of aSlide as text
do shell script "echo '" & slideNote & "' >> ~/keynote-notes.txt"
do shell script "echo '' >> ~/keynote-notes.txt"
end repeat
end tell
quit application "Keynote"
end tell
@tbrk
Copy link

tbrk commented Apr 6, 2021

Thanks for posting your version of this script. I would just note that the global variable should probably be slideNote and also that the pbpaste in the original script is better because it has no problems with single quotes in the presenter notes.

...
set the clipboard to slideNote
do shell script "pbpaste >> ~/keynote-notes.txt"
...

@steve02476
Copy link

Hmmm, I was able to successfully run the script on stackexchange and it dumped the notes onto the clipboard. I just copied it into ScriptEditor and hit the "run" triangle button. But the script here gives errors when I try to run it the same way, ScriptEditor result is:

error "Keynote got an error: sh: line 4: Advisory: command not found
sh: line 6: Always: command not found
sh: line 8: Explain: command not found
sh: line 9: Current: command not found
sh: line 11: Apology: command not found
sh: line 12: The: command not found
sh: line 13: We: command not found
sh: line 14: This: command not found
sh: -c: line 15: unexpected EOF while looking for matching `''
sh: -c: line 16: syntax error: unexpected end of file" number 2

Maybe the tbrk comment is the solution - but I don't know how to make the change? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment