The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   This script should be *so* easy … (http://forums.omnigroup.com/showthread.php?t=14114)

Zoolok 2009-10-10 12:00 AM

This script should be *so* easy …
 
… but I'm a total Applescript doofus!
I'm using Hazel to move files from my Downloads folder but I want to add them to a task in OF too.
The basic idea is once the file is moved I want a new task with the name "Read Bulletin", put into a specified project, with a due date in the next 3 days.

I can't get my head around the syntax ... I have tried

tell application "OmniFocus"
activate
make new task with properties {duedate:3days, name:ReadBulletin}
end tell

(doesn't like the properties! Delimiters and undefined variables, apparently)

Anyone care to help?
(This is what Automator was built for!)

Thanks in advance

whpalmer4 2009-10-10 12:42 AM

The following code will make a task in the Inbox with your specified name and due date:

[code]
property ActionName : "ReadBulletin"
property DueDateOffset : 3 * (24 * 60 * 60)

tell application "OmniFocus"
activate
tell default document
make new inbox task with properties {name:ActionName, due date:((current date) + DueDateOffset)}
end tell
end tell
[/code]

Zoolok 2009-10-10 07:35 AM

Thank you! That's exactly what I wanted. I guessed it would have something to do with declaring variables somewhere, but I didn't have a clue how to fit it all together!


All times are GMT -8. The time now is 11:43 PM.

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