Skip to content

Instantly share code, notes, and snippets.

@semicolonsnet
Created March 14, 2019 15:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semicolonsnet/ccfad9f197a262690c0fc7fb12876e20 to your computer and use it in GitHub Desktop.
Save semicolonsnet/ccfad9f197a262690c0fc7fb12876e20 to your computer and use it in GitHub Desktop.
AppleScript to output notes from all PDFs in a directory as "Notes as Markdown", using my template for the Skim PDF editor.
set this_folder to ""
set export_folder to ""
set these_files to every file of folder this_folder whose name extension is "pdf"
end tell
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
set fileName to name of item i of these_files
set savePath to export_folder & ":" & fileName & ".md"
tell application "Skim"
open this_file
try
convert notes document 1 with waiting
end try
if (count of notes in document 1) > 0 then
save document 1 in savePath as "Notes as Markdown"
end if
close document 1 saving no
end tell
log i
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment