Last active
August 8, 2017 19:30
-
-
Save derickfay/4838fb9792a627bf2954 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