Created
September 5, 2014 05:23
-
-
Save bachya/7eb70e95f2ff12fce918 to your computer and use it in GitHub Desktop.
Smart Applescript that allows tasks to be entered into OmniFocus, even if it's not open
This file contains 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
-- Determine whether OmniFocus is running. | |
tell application "System Events" | |
set omnifocusActive to count (every process whose name is "OmniFocus") | |
end tell | |
if omnifocusActive > 0 then | |
-- OmniFocus is running, so insert a task into it directly. | |
tell application "OmniFocus" to tell document 1 | |
make new inbox task with properties {name:"TASK TITLE"} | |
end tell | |
else | |
-- OmniFocus isn't running, so use the Mail Drop method. | |
do shell script "mail -s \"TASK TITLE\" " & mailDropAddress & " < /dev/null" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment