View Single Post
Originally Posted by Dale View Post
I know this is not a full solution, but I thought you might be interested in two associated articles and scripts for creating tasks in OmniFocus via Hazel.

This was what I have so far.

tell application "Finder" to set file_name to (name of theFile)

tell application "OmniFocus"
	set task_title to "Pay " & file_name
	tell default document
		set theContext to first flattened context where its name = "iMac"
		set newTask to make new inbox task with properties {name:task_title, context:theContext}
		tell the note of newTask
			make new file attachment with properties {file name:theFile, embedded:false}
		end tell
	end tell
end tell
I can get a task with attachment and context into the inbox. The addition of sending it to a project per the method from the David Sparks script does not work.

To get the obvious out of the way yes, I did replace the "make new inbox task" with "make new task" when testing this with a line similar to

set theProject to first flattened project where its name = "Finance"
All comment and suggestions welcome.

Thank you in advance.
Hi Dale,

thanks for sharing this. I've tried this one but it's not doing anything to my OmniFocus. I'm wondering if this could be because I have a german OSX?