Created
July 5, 2013 18:30
-
-
Save arkadyan/5936367 to your computer and use it in GitHub Desktop.
Make an OmniFocus inbox entry from a GitHub ticket you are viewing in Safari.
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 "Safari" | |
set ticketPage to the document of the front window | |
set ticketUrl to the URL of ticketPage | |
set nameArray to my splitText((name of ticketPage), " · ") | |
set ticketTitle to the first item of nameArray | |
end tell | |
tell application "OmniFocus" to tell default document | |
make new inbox task with properties {name:ticketTitle, note:ticketUrl} | |
end tell | |
on splitText(someText, delimiter) | |
set prevTIDs to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to delimiter | |
set output to text items of someText | |
set AppleScript's text item delimiters to prevTIDs | |
return output | |
end splitText |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment