Skip to content

Instantly share code, notes, and snippets.

@jdsimcoe
Created September 1, 2014 20:36
Show Gist options
  • Save jdsimcoe/e18ec27679c08a2e7432 to your computer and use it in GitHub Desktop.
Save jdsimcoe/e18ec27679c08a2e7432 to your computer and use it in GitHub Desktop.
Tells OmniFocus to open and activates the Quick Entry if it is not already open. Does nothing if it is open. This script is modified to work with the Standard App Store version of OF2. It assumes that your Quick Entry shortcut is “control + option + command + t” like mine is. Fork and modify at will!
set GTDAppName to "OmniFocus"
global GTDAppName
set GTDAppToUse to FindRunningGTDApp()
if (GTDAppToUse is null) then
set GTDAppToUse to "OmniFocus"
end if
-- Is OmniFocus running?
on AppIsRunning(GTDAppName)
tell application "System Events"
return (count of (application processes whose name is GTDAppName)) is not 0
end tell
end AppIsRunning
-- If OmniFocus is running, do nothing.
-- If OmniFocus is not running, launch it and bring up the Quick Entry Panel.
on FindRunningGTDApp()
if AppIsRunning(GTDAppName) then
null
else
tell application "OmniFocus"
activate
end tell
tell application "System Events" to tell process GTDAppName
keystroke "t" using {control down, option down, command down}
end tell
end if
return null
end FindRunningGTDApp
@jdsimcoe
Copy link
Author

jdsimcoe commented Sep 3, 2014

Like I have stated above, this script assumes that your Quick Entry shortcut is control + option + command + t, like mine is set to. If you want to modify it to suit your needs, simply edit Line 25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment