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 > OmniPlan > OmniPlan Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
what is the fastest way to search tasks based on custom data in AppleScript Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
For some of my tasks I have a custom data field "tracid" set. In AppleScript I need to find the task where the tracid is set to a particular value.

Currently I am just iterating over the list of tasks until I find the one I want. Is there any faster way to do this?

Code:
-- Finds a Task
--   _id : tracid of task
on findTask(_id)
	tell application "OmniPlan"
		tell first document
			
			repeat with t in tasks
				set customData to get custom data of t
				if customData is not {} then
					if (tracid of customData = _id) then
						return t
					end if
				end if
			end repeat
			
			return false
			
		end tell
	end tell
end findTask
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can custom data be printed jethiele OmniPlan General 5 2012-04-20 10:27 AM
Custom text exports from OmniFocus (applescript-based query language) RobTrew OmniFocus Extras 0 2011-01-14 06:08 AM
Searching custom data edwagner OmniPlan General 1 2010-09-17 09:19 PM
OmniOutliner: Fastest way to set data in rows, columns or blocks? nelsonm AppleScripting Omni Apps 3 2009-07-27 02:45 PM
Setting Task Custom Data using Applescript jubo OmniPlan General 6 2007-08-22 10:05 AM


All times are GMT -8. The time now is 05:43 AM.


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