Would there be a way to take this Folder action script and modify it to add a default Project and context to the action as well?
Here on David Sparks site he shows how to make an action via applescript with a default project and context:
– Lovingly crafted by David Sparks, The Omni Group, and Ben Waldie – macsparky.com
set theDate to current date
set theTask to “Pay Life Insurance”
set theNote to "Lovingly Scanned by your Mac on " & (theDate as string)
tell application “OmniFocus”
tell front document
set theContext to first flattened context where its name = “Tech”
set theProject to first flattened project where its name = “Finance”
tell theProject to make new task with properties {name:theTask, note:theNote, context:theContext}
end tell
end tell
And here is a Folder Action that automatically adds the file to the inbox of OmniFocus but without a default Project or Context via dave at the OmniGroup:
property pEmbedFile : true (* if true, file will be embedded
if false, file will be linked )
property pUseQuickEntry : false ( if true, Quick Entry window used and left open
if false, actions added directly to Inbox *)
on adding folder items to this_folder after receiving added_items
try
repeat with i from 1 to number of items in added_items
set this_item to item i of added_items
tell application “Finder” to set file_name to (name of this_item)
tell application “OmniFocus”
if (pUseQuickEntry) then
tell quick entry
open
set NewTask to make new inbox task with properties {name:file_name}
tell the note of NewTask
make new file attachment with properties {file name:this_item, embedded:pEmbedFile}
end tell
activate
end tell
else
tell front document
set NewTask to make new inbox task with properties {name:file_name}
tell the note of NewTask
make new file attachment with properties {file name:this_item, embedded:pEmbedFile}
end tell
end tell
end if
end tell
end repeat
end try
end adding folder items to
I am trying to accomplish some rather in depth Hazel, Paperless, automatic OCRing mojo and I thought I could simply look at the applescripts and combine them myself, but… Way beyond me. I know someone with some AppleScript chops can do it, probably in an instant.
Many many thanks in advance.