Last active
September 3, 2021 09:35
-
-
Save 1024jp/1c13e597a22ce89ac26c7dd5bfcf46de to your computer and use it in GitHub Desktop.
Extract Presenter Notes
This file contains 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
(* | |
Extract presenter notes of the front most Keynote document and save to Desktop as Markdown file. | |
Created by 1024jp on 2019-03-16. | |
© 2019 1024jp | |
*) | |
-- collect presenter notes | |
tell front document of application "Keynote" | |
set thePresentationTitle to name | |
set presenterNotes to "# " & name & return & return | |
repeat with i from 1 to count of slides | |
repeat 1 times -- # fake loop for loop continue | |
tell slide i | |
if presenter notes is "" then exit repeat | |
set theTitle to "## " & i & ". " & object text of default title item | |
set presenterNotes to presenterNotes & theTitle & return & return & presenter notes & return & return | |
end tell | |
end repeat | |
end repeat | |
end tell | |
-- create path to file | |
set theFileName to "presenterNotes-" & thePresentationTitle & ".md" | |
set theFilePath to (path to desktop folder as text) & theFileName | |
-- save to the file | |
try | |
set theFile to open for access theFilePath with write permission | |
on error | |
close access file theFilePath | |
return | |
end try | |
set eof of theFile to 0 | |
write presenterNotes to theFile as «class utf8» | |
close access theFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment