How to Add In Right-click Menu or ‘Shorten URL’ Keyboard Shortcut Using Automator [Tutorial]
As we know in order to shorten URLs lots of people use services like bit.ly. Also this can be done by using websites, browser bookmarklets, or come apps like TweetDeck in order to shorten URLs. Well, Good news is that now you can enable link shortening from within any app by using Automator. Simply follow the step by step instructions posted below in order to add in right-click menu or ‘Shorten URL’ Keyboard Shortcut using Automator. Now follow the steps carefully.
INSTRUCTIONS
STEP 1. First you have to open Automator by navigating to Applications>Automator. Now you have to double click the Service icon in order to create a new script. If you will not be able to see the below image when launching automator then you have to select File>New.
STEP 2. You should note that the two drop down lists at the top of Automator should be set to “Service receives selected URLs in any application. The “Replaces selected text” checkbox should remained unchecked.
STEP 3. Now from the left hand panel, you have to navigate to Library>Utilities>Run AppleScript and drag Run AppleScript into your project on the right.
STEP 4. Now simply replace the default Run AppleScript text with the following:
on run {input}
set inputResult to (input as string)
ignoring caseif (((characters 1 thru 4 of inputResult) as string) is not equal to “http”) then
display dialog “Invalid URL”else
set curlCMD to “curl –stderr /dev/null \”http://bit.ly/api?url=” & input & “\””
set tinyURL to (do shell script curlCMD)
return tinyURLend if
end ignoring
end run
STEP 5. Now you have to navigate to Library>Utilities> in the left panel and drag Copy to Clipboard underneath the Run AppleScript action in your workflow on the right.
STEP 6. Now you have to save your Automator Service and then name it something you will recognize, just like “Shorten URL”.
That’s it. In this way you can add in right-click menu or ‘Shorten URL’ Keyboard shortcut using Automator. Now you will be able to shorten any URL from any menu of the application using the bit.ly API. You should note that this method will work only for the users running Mac OS X version 10.6 or later. If you found any difficulty in following the above steps the feel free to ask in the comment section below. As usual stay tuned with us for more updates.
Related posts:
- How to Enable “Right-Click” on Mac Laptop [Tutorial]
- How to Add an Eject Button to Mac OS X Menu Bar [Tutorial]
- How to Create Keyboard Shortcut to Enter and Exit Full Screen App Mode in Mac OS X Lion
- How to Lock Mac OS X Desktop via Menu Bar [Tutorial]
- How to Clear “Open With” Menu in Mac OS X [Tutorial]
- Check App Store Updates with Keyboard Shortcut [How To]
- How To Disable Right Click in Blogger/Blogspot Blogs!
- Check your Facebook Privacy Settings in One Click
- How to Unlock or Root Nexus S Using Automatic Scripts on Linux [Tutorial]
- How to Enable “Click to Play” for Plug-ins & Flash in Google’s Chrome Web Browser on Mac
Filed in: Mac • Technology






