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

 
Searching in AppleScript Thread Tools Search this Thread Display Modes
Is there a proper way to search for tasks/projects in AppleScript containing a string (much like the Search toolbar item), short of looping through projects/folders and manually checking each task?
 
Provided that that the toolbar has a search panel, you can set the search term using Applescript. e.g.

Code:
tell application "OmniFocus"
	tell front window
		try
			set search term to "tax"
		end try
	end tell
end tell
 
When running the above script, you need to run it from inside Omnifocus, so that the front window call gets you the front window. Alternatively, you can use the description "first" window (assuming that is the topmost) which will work within script-editor.

Note that "first window" will give you an error unless the script is run within omnifocus.

-Allen

ps- remove "try" commands to see the errors that get thrown otherwise.

Update: I'm using the following subprogram in a project I'm working on right now...
Code:
on SetSearch(searchstring)
	tell application "OmniFocus"
		tell front document
			tell document window 1
				set search term to searchstring
			end tell
		end tell
	end tell
end SetSearch

Last edited by a11en; 2008-08-30 at 01:07 PM..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching notes scotty321 OmniFocus for iPad 3 2012-01-25 08:38 PM
Searching in OF jochen OmniFocus 1 for Mac 3 2010-01-23 06:15 AM
Applescript: Searching for tasks that fit specific requirements a11en OmniFocus Extras 5 2008-08-30 06:50 PM
Searching by date Goldendog OmniFocus 1 for Mac 1 2008-04-09 03:33 PM
Searching Forrest Forums Feedback 0 2006-06-03 07:55 AM


All times are GMT -8. The time now is 10:41 AM.


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