Skip to content

Instantly share code, notes, and snippets.

@jpwagner
Created November 18, 2013 00:05
Show Gist options
  • Save jpwagner/7520094 to your computer and use it in GitHub Desktop.
Save jpwagner/7520094 to your computer and use it in GitHub Desktop.
quick applescript hack to export everything out of Cultured Code's Things into a flat file
tell application "Things"
set delimiter to " "
set wrapper to "\""
set newItem to return
set my_file to (((path to desktop folder) as string) & "things_export.txt")
--set plainTextFile to choose file name with prompt "Choose target text file..."
try
set the plainTextFile to open for access file my_file with write permission
on error
display dialog "Cannot open file for writing!"
return
end try
repeat with toDo in the to dos
set toDoName to name of toDo
set toDoNotes to notes of toDo
set toDoDue to due date of toDo
set toDoTags to tag names of toDo
if toDoName is not missing value then write (wrapper & toDoName & wrapper) as text to plainTextFile
write (delimiter) as text to plainTextFile
if toDoDue is not missing value then write (wrapper & toDoDue & wrapper) as text to plainTextFile
write (delimiter) as text to plainTextFile
if toDoNotes is not missing value then write (wrapper & toDoNotes & wrapper) as text to plainTextFile
write (delimiter) as text to plainTextFile
if toDoTags is not missing value then write (wrapper & toDoTags & wrapper) as text to plainTextFile
write (newItem) as text to plainTextFile
end repeat
close access the plainTextFile
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment