Skip to content

Instantly share code, notes, and snippets.

@joebuhlig
Created April 22, 2015 12:27
Show Gist options
  • Save joebuhlig/0e8a29e5f91ac9533f89 to your computer and use it in GitHub Desktop.
Save joebuhlig/0e8a29e5f91ac9533f89 to your computer and use it in GitHub Desktop.
Use this script in Hazel to create a hotspot that makes tasks out of files in Omnifocus.
tell application "Finder" to set file_name to (name of theFile)
set theDate to current date
set theNote to "Imported on:" & (theDate as string) & "
"
set projectname to "Test Project"
set theTask to "Review File: " & file_name
tell application "OmniFocus"
set task_title to theTask
tell default document
set newTask to make new inbox task with properties {name:task_title}
set note of newTask to theNote
tell the note of newTask
make new file attachment with properties {file name:theFile, embedded:false}
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment