Created
March 14, 2019 15:43
-
-
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.
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
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