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

 
Does OmniFocus AppleScript support work properly yet? Thread Tools Search this Thread Display Modes
The reason I ask is because I have been trying to figure out how to manipulate the tasks dates but I am having zero success. The entry in my scripts is:

Code:
tell application "OmniFocus"
    tell default document
        set var1 to start date of task as date
    end tell
end tell
And I keep getting errors - this is a very simple example but I would think that if this doesn't work, then more complex operations surely will not work.

Maybe I am not understanding the OmniFocus Dictionary properly - any help is greatly appreciated.

Thanks.

Last edited by aleding; 2008-01-30 at 04:29 PM..
 
The applescript support is good and works well.

In your code fragment you have not specified which task you are referring to.

An inbox task ? A project task ? If so which project ?

Whether inbox or project tasks, which task specifically ?

The following, for example, would at least conform to the structure of the dictionary:

Code:
tell application "OmniFocus"
	tell default document
		set var1 to start date of first inbox task
	end tell
end tell
 
RobTrew - thanks for the insight and also for letting me know I'm likely not chasing my tail here.

So to your question - I would like to also be able to work an a task within a project - say the project name is "CTI", any idea how I would access certain tasks within that project?

Last edited by aleding; 2008-01-30 at 04:30 PM..
 
Quote:
Originally Posted by aleding View Post
say the project name is "CTI", any idea how I would access certain tasks within that project?
You can either recursively move down through the folders and their project lists until you find a project with a matching name, or you can use the "Complete" method of the Document class, which returns a list of records giving details of any projects or categories with names that fully or partially match some string that you have provided. You can then use the supplied id of a matching project to get a full reference to that project.

For example:

Code:
tell application "OmniFocus"
	set oDoc to front document
	set oProject to my FindProject(oDoc, "CTI")
end tell


on FindProject(oDoc, strProjName)
	using terms from application "OmniFocus"
		tell oDoc
			set recsMatch to complete strProjName as project maximum matches 1
			if length of recsMatch > 0 then
				set oProject to project id (id of item 1 of recsMatch)
			end if
		end tell
	end using terms from
end FindProject
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you properly balance project vs. task work? Rutilate Applying OmniFocus 5 2012-03-24 06:47 PM
Need Assistance: AppleScript to Properly File Inbox Task Based on Textual Tag of Name WCityMike OmniFocus Extras 2 2009-10-24 09:47 PM
OmniFocus PDF Manual not printing properly.. edward1234 OmniFocus 1 for Mac 2 2009-05-22 01:28 PM
AppleScript support wish list philb OmniWeb Feature Requests 0 2008-02-16 02:24 PM
Localhost cookies don't work properly kballard OmniWeb Bug Reports 0 2006-05-03 02:05 AM


All times are GMT -8. The time now is 12:10 PM.


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