Skip to content

Instantly share code, notes, and snippets.

@chrisfsmith
Created September 9, 2013 19:34
Show Gist options
  • Save chrisfsmith/6500387 to your computer and use it in GitHub Desktop.
Save chrisfsmith/6500387 to your computer and use it in GitHub Desktop.
Automator service applescript that opens a JIRA issue in chrome. Use it from Launchbar.
on run {input, parameters}
set sedCommand to "echo \"" & input & "\" | sed \"s/^[ ]*//;s/[ ]*$//;s/[ ]\\{1,\\}/-/g;s/-\\{1,\\}/-/\"" as string
set sedResult to do shell script sedCommand
set currentURL to "https://bloomhealthco.atlassian.net/browse/" & sedResult
if currentURL is not "" then
tell application "Google Chrome"
activate
if (exists window 1) and (URL of active tab of window 1 is "chrome://newtab/") then
tell window 1 to set URL of active tab to currentURL
else
open location currentURL
end if
end tell
end if
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment