Twitter and other online services have made shortening URLs a routine job. But such URLs aren’t just for social networks; they can help any time you share links (especially long ones). There are plenty of ways to shorten URLs – some methods are built into specific programs. But if you’d like to have a shortening tool available all the time,
in almost any app you use, you can build a Mac OS X service in Automator that’ll do the job.

Open Automator and opt to create a new service. In the top bar, set Service Receives to URLs and In to Any Application. Next, drag over the Run AppleScript action (from the Utilities section), copy the code from then paste it into the Automator entry window, replacing anything that was already there. Below the Run AppleScript action, drag in the Copy To Clipboard action. Save the service with a name like Shorten URL.

You should now be able to Control-click any URL in any program and select Shorten URL from the Services submenu; the shortened URL should then be available in your clipboard, ready for pasting wherever you need it.

Note: This hint relies on the shortening service. You can use other services too, as long as they have APIs. To use a different service, replace in the script with the appropriate URL for the shortener you want to use; the syntax is usually