Created
March 14, 2013 23:19
-
-
Save simX/5166113 to your computer and use it in GitHub Desktop.
Quick AppleScript to export all your notes from Apple's built-in Notes.app application
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
tell application "Notes" | |
set note_body_list to (get body of every note) | |
end tell | |
set note_count to (count of note_body_list) | |
set blah_folder to choose folder | |
set blah_path to POSIX path of blah_folder | |
repeat with i from 1 to note_count | |
set filename_string to ((blah_path & "note" & (i as string) & ".html") as text) | |
try | |
set newFile to open for access POSIX file filename_string with write permission | |
set string_to_write to (get item i of note_body_list) | |
write string_to_write to newFile as text | |
close access newFile | |
on error | |
try | |
close access (POSIX file filename_string) | |
end try | |
end try | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment