Skip to content

Instantly share code, notes, and snippets.

@simX
Created March 14, 2013 23:19
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 simX/5166113 to your computer and use it in GitHub Desktop.
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
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