Forked from derickfay/export text from el capitan notes.applescript
Created
May 16, 2017 08:51
-
-
Save able8/9f74fff42f1a900578f351804be30208 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
set theDate to do shell script "date '+%Y-%m-%d'" | |
set outputPath to "~/Dropbox/mytemp/" | |
set format to "txt" | |
set counter to 1 | |
set theFolder to "Notes" | |
-- uses a counter to avoid duplicate filenames if notes have the same title | |
tell application "Notes" | |
tell folder theFolder | |
set theNotes to every note | |
repeat with n in theNotes | |
set t to body of n | |
do shell script "echo " & quoted form of t & "| textutil -format html -convert " & format & " -stdin -output " & outputPath & "/" & quoted form of ((name of n) as string) & "_" & counter & "_" & theDate & "." & format | |
set counter to counter + 1 | |
end repeat | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment