Skip to content

Instantly share code, notes, and snippets.

@myles
Created April 4, 2012 15:51
Show Gist options
  • Save myles/2303114 to your computer and use it in GitHub Desktop.
Save myles/2303114 to your computer and use it in GitHub Desktop.
Text File to Things Task using Dropbox and Hazel
tell application "Things beta"
set fileContents to read theFile using delimiter {linefeed}
repeat with currentLine in reverse of fileContents
set newToDo to make new to do with properties {name:currentLine}
end repeat
end tell
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {":"}}
set theFileName to last text item of (theFile as text)
set theName to text 1 thru -9 of theFileName
set theNote to read theFile as string
tell application "Things beta"
set newToDo to make new to do with properties {name:theName}
set notes of newToDo to theNote
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment