Created
September 1, 2014 20:36
-
-
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 editLine 25
.