The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
This script should be *so* easy … Thread Tools Search this Thread Display Modes
… 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
 
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
 
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!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tags are possible in OF, and quite easy gandalf44 OmniFocus 1 for Mac 5 2013-04-14 06:46 AM
setting project + context via script (modifying a DEVONthink script) bernd OmniFocus Extras 2 2012-09-08 12:10 PM
Hopefully an Easy Question Amovida OmniOutliner 3 for Mac 3 2011-03-22 08:13 PM
Easy hot keys BevvyB OmniFocus 1 for Mac 3 2009-04-23 12:20 PM


All times are GMT -8. The time now is 11:45 AM.


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