Created
May 17, 2015 01:24
-
-
Save nadavspi/d7350e6cc24c5f12c15a to your computer and use it in GitHub Desktop.
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
tell application "OmniFocus" | |
tell front document | |
tell document window 1 | |
set theSelectedItems to selected trees of content | |
if ((count of theSelectedItems) < 1) then | |
display alert "You must first select a single task." message "Select a single task before running this script." as warning | |
return | |
end if | |
if ((count of theSelectedItems) > 1) then | |
display alert "This script handles only one task at a single blow!" message "Select a single task before running this script." as warning | |
return | |
end if | |
end tell | |
end tell | |
end tell | |
tell application "OmniFocus" | |
set theDoc to document window 1 of document 1 | |
set theSelectedTask to the value of the first item of the selected tree of the content of theDoc | |
set theNewTask to the name of theSelectedTask | |
set the clipboard to theNewTask | |
end tell | |
tell application "Alfred 2" to run trigger "toggl start timer" in workflow "com.jason0x43.alfred-toggl" with argument "timers " & (the clipboard as text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment