Created
May 3, 2016 03:55
-
-
Save adriangrantdotorg/a7320c18f7b5f223709c105144a3be36 to your computer and use it in GitHub Desktop.
Automator Service to launch clipboard item in default Browser
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
| c=$(echo $@ | xargs) | |
| urlFixer='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' | |
| if [[ "$c" =~ $urlFixer ]]; then | |
| open "$c" | |
| else | |
| open http://"${c//[[:space:]]}" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment