PDA

View Full Version : Shortcuts to Where in OF searches


RobTrew
2012-01-31, 11:29 PM
An experimental feature in version .740 of Where in OF (http://bit.ly/OF-Find2) which you are very welcome to test.

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 ...

If you place a copy of Where in OF (.740 and above) in your OmniFocus scripts folder:

~/Library/Scripts/Applications/Omnifocus/

You can then create very simple shortcut scripts, which jump straight to frequently-used searches, along the lines of:

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

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:

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

rather than having to modify any shortcut scripts if you download a later version.

tasks where (name contains <txt>) or (note contains <txt>)

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.

--

RobTrew
2012-02-01, 02:42 PM
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:

~/Library/Scripts/Applications/Omnifocus/WhereInOF.app

(Where ~ is a system-recognised abbreviation for your home folder)

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

--