The Omni Group Forums

The Omni Group Forums (
-   OmniFocus Extras (
-   -   Adjusting of AppleScript to add project, context and start date (

Mburch 2014-03-25 05:36 AM

Thanks Dale. Got it how would I add a file with variable file_name as an attachment? Here's what I've got so far

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

tell application "OmniFocus"
set theTask to "Read " & file_name
set dueDate to (current date)
set time of dueDate to 0 + (16 * hours)
set startDate to (current date)
tell default document
set theContext to first flattened context where its name = "Device"
set theFolder to first flattened folder where its name = "Work"
set theProject to first flattened project of theFolder where its name = "Read"
tell theProject to make a new task with properties {name:theTask, context:theContext, due date:dueDate, start date:startDate, estimated minutes:"15"}
end tell
end tell

Dale 2014-04-11 04:58 PM

Sorry for such a late response. I have been in the new OmniFocus forum for OF2.

I am not sure if you are wanting a linked file or an embedded file.

I would suggest taking the script from Rob Trew in post [URL=""]26[/URL] of this thread and modifying that script. You should be able to verify the current script variables are correct for you situation and add in the requirement in placing a task into a specific folder. I hope this helps.

You should also know the AppleScript library for OF2 has been changed and this can effect current scripts. I have not tested any scripts in OF2 and will probably not do so until it is officially released and determined if I am going to upgrade to the new version, continue using OF1, or moving to another solution.

All times are GMT -8. The time now is 06:31 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.