Forked from benwaldie/2014-04-03 Send Keynote Presenter Notes to Evernote.applescript
Last active
March 3, 2023 15:15
-
-
Save RichardDooling/5e616a40d2969ba136a4 to your computer and use it in GitHub Desktop.
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
--============================== | |
-- Send Keynote Text to Desktop Markdown File | |
-- Writted By: Richard Dooling https://github.com/RichardDooling/ | |
-- Based on | |
-- Send Keynote Presenter Notes to Evernote | |
-- Version 1.0.1 | |
-- Written By: Ben Waldie <[email protected]> | |
-- http://www.automatedworkflows.com | |
-- Version 1.0.0 - Initial release | |
-- Version 1.0.1 - Updated for Keynote 6.2 compatibility | |
--============================== | |
-- Make sure a presentation is opened in Keynote. If not, notify the user and stop. | |
tell application "Keynote" | |
if (front document exists) = false then | |
display alert "Unable to proceed." message "Please open a presentation in Keynote." | |
return | |
end if | |
set extractBody to button returned of (display alert "Would you like to extract slide content too?" buttons {"Yes", "No"}) = "Yes" | |
-- Target the front presentation. | |
tell front document | |
-- Get the name of the presentation. | |
set thePresentationName to name | |
-- Retrieve the titles of all slides. | |
set theTitles to object text of default title item of every slide | |
-- If specified, retrieve the body text of all slides | |
if extractBody = true then | |
set theBodyText to object text of default body item of every slide | |
end if | |
-- Retrieve the presenter notes for all slides. | |
set theNotes to presenter notes of every slide | |
end tell | |
end tell | |
-- Prepare the notes as Markdown. | |
set theFormattedNotes to "# " & "Keynote Presentation: " & thePresentationName & return & return | |
repeat with a from 1 to length of theTitles | |
set theFormattedNotes to theFormattedNotes & "## Slide " & a & return & return | |
set theFormattedNotes to theFormattedNotes & "### Title: " & item a of theTitles & return & return | |
if extractBody = true then | |
set theFormattedNotes to theFormattedNotes & "#### Body " & return & return & item a of theBodyText & return & return | |
end if | |
set theFormattedNotes to theFormattedNotes & "#### Presenter Notes: " & return & return & item a of theNotes & return & return | |
end repeat | |
set theFormattedNotes to theFormattedNotes & return | |
-- Replace any returns with line breaks. | |
set AppleScript's text item delimiters to {return, ASCII character 10} | |
set theFormattedNotes to text items of theFormattedNotes | |
set AppleScript's text item delimiters to {return, ASCII character 10} | |
set theFormattedNotes to theFormattedNotes as string | |
set AppleScript's text item delimiters to "" | |
tell application "TextEdit" | |
activate | |
-- Create Desktop Markdown .md file named after Presentation | |
set theDesktopPath to the path to the desktop folder as text | |
make new document with properties {text:theFormattedNotes} | |
save document 1 in file (theDesktopPath & thePresentationName & ".md") | |
close document 1 | |
end tell | |
Wow, it still works. Great!
Rick
…On Tue, Sep 29, 2020 at 8:47 AM Georgios Karamanis ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Thank you, great script!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/5e616a40d2969ba136a4#gistcomment-3471323>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALILQWSO4FF35MZ7RIXTYDSIHXQTANCNFSM4R54ZLZQ>
.
--
rd
Thank you!
This looks great and just what I need.
But I have no idea how to use it, or even where to put it. ;-)
Can someone advise?
Thanks!
Aha! Good ol' AppleScript.
File runs but doesn't save; appears to stop at
save document 1 in file (theDesktopPath & thePresentationName & ".md")
Any suggestions?
I haven't had to use to the script in a while, but just tested it to
confirm that it still works. I did have to look at the script to find the
file, I had forgotten that it saves to the Desktop, not the folder that
contains the Keynote file.
…On Fri, Jul 23, 2021 at 3:30 PM gpfriend ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
This looks great and just what I need.
But I have no idea how to use it, or even where to put it. ;-)
Can someone advise?
Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/5e616a40d2969ba136a4#gistcomment-3826494>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAESL2VR63EVGKA4S4SWO3DTZHGOXANCNFSM4R54ZLZQ>
.
thanks for the script. FYI this still works with Keynote 12.2.1 but does ask for permission to access Desktop, in line with security changes.
Amazing it still works!
…On Wed, Jan 4, 2023 at 3:10 PM Neil Ernst ***@***.***> wrote:
@neilernst commented on this gist.
________________________________
thanks for the script. FYI this still works with Keynote 12.2.1
—
Reply to this email directly, view it on GitHub or unsubscribe.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS or Android.
--
rd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, great script!