The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Shortcuts to Where in OF searches (http://forums.omnigroup.com/showthread.php?t=23362)

RobTrew 2012-01-31 11:29 PM

Shortcuts to Where in OF searches
 
An experimental feature in [URL="http://bit.ly/OF-Find2"]version .740 of Where in OF[/URL] which you are very welcome to test.

[B]NB these shortcut scripts currently only work from the script menu, LaunchBar, etc - don't try to run them from the OmniFocus toolbar - on which they seem to cause a freeze ...[/B]

If you place a copy of Where in OF (.740 and above) in your OmniFocus scripts folder:
[INDENT][I]~/Library/Scripts/Applications/Omnifocus/[/I][/INDENT]
You can then create very simple shortcut scripts, which jump straight to frequently-used searches, along the lines of:

[CODE]do shell script "osascript ~/Library/Scripts/Applications/Omnifocus/WhereInOF740.app \"tasks where (name contains <txt>) or (note contains <txt>)\""[/CODE]

As such scripts need to use the exact name of the WhereInOF app, it may be sensible to rename a copy of .app file, dropping the version affix, to WhereInOf.app, so that you can write:

[CODE]do shell script "osascript ~/Library/Scripts/Applications/Omnifocus/WhereInOF.app \"tasks where (name contains <txt>) or (note contains <txt>)\""[/CODE]

rather than having to modify any shortcut scripts if you download a later version.
[INDENT][I]tasks where (name contains <txt>) or (note contains <txt>)[/I][/INDENT]
is a useful general string search, which will also find strings in project names and notes, and you may want searches which give a more date-based or status-based custom filtering.

Thanks to whpalmer4 for suggesting saved searches which could be fired off by simple scripts.

[COLOR="White"]--[/COLOR]

RobTrew 2012-02-01 02:42 PM

1 Attachment(s)
A general LaunchBar script for string searches which use Where In OF.

(Choose the script with a LaunchBar abbreviation, and then tap the space-bar to enter the string you want to search for).

Assumes that the Where In OF .app file has has the following path and name:
[INDENT][I]~/Library/Scripts/Applications/Omnifocus/WhereInOF.app[/I][/INDENT]
(Where ~ is a system-recognised abbreviation for your home folder)

[CODE]on handle_string(strQuery)
set str to do shell script ("osascript ~/Library/Scripts/Applications/Omnifocus/WhereInOF.app 'tasks where (name contains \"" & strQuery & "\") or (note contains \"" & strQuery & "\")'")
end handle_string[/CODE]

[COLOR="White"]--[/COLOR]


All times are GMT -8. The time now is 06:02 PM.

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