Skip to content

Instantly share code, notes, and snippets.

@bjmorgan
Last active December 24, 2015 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjmorgan/6786479 to your computer and use it in GitHub Desktop.
Save bjmorgan/6786479 to your computer and use it in GitHub Desktop.
AppleScript for triggering a search in OmniFocus from LaunchBar. Accepts text items from Launchbar (hit space, or send a text item to the script), or prompts the user for a search query.
on handle_string(the_string)
if (length of the_string is 0) then
display dialog "Search OmniFocus for:" default answer ""
end if
open location "x-launchbar:hide"
my search_in_omnifocus(the_string)
end handle_string
on search_in_omnifocus(the_search_string)
tell application "OmniFocus"
activate
tell front window
try
set search term to the_search_string
end try
end tell
end tell
end search_in_omnifocus
display dialog "Search OmniFocus:" default answer ""
set the_string to text returned of result
my search_in_omnifocus(the_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment