View Single Post
I am trying to get my leads into omni focus from my action folder (Macsparky inspired) along with the actual pdf AND have a context and project. I can get most of the way there using cobbled together scripts. The Problem is I can't get it all to happen. I either get a context and project or I get the file.

I am new to AppleScript, I have done some programming in the past but cannot seem to get this to work. Here is my script. It doesn't work but hopefully you can see what I'm trying to do.

set theDate to current date
tell application "Finder" to set file_name to (name of theFile)
set theNote to "Scanned " & (theDate as string) & "

"
set theProject to "Sales"
set theContext to "Phone"

set theTask to "Call \"" & file_name & "\""

tell application "OmniFocus"
tell theProject
make new task with properties {name:theTask, context:theContext}
set note of theTask to theNote
tell the note of theTask
make new file attachment with properties {file name:theFile, embedded:true}
end tell
end tell
end tell

Please help, I'm totally lost.