Auto shorten any url's that are copied to clipboard

Discussion in 'Mac Apps and Mac App Store' started by Shawzborne, Aug 1, 2013.

  1. Shawzborne macrumors 6502a

    Shawzborne

    Joined:
    Jun 12, 2013
    #1
    Hi Guys,

    Im looking for something that can auto-shorten any urls that are detected in the mac clipboard and then be able to paste the link anywhere on the mac just by using default paste command.

    Thank-you,

    Shawn
     
  2. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #2
    Not exactly what you wanted, but this Applescript will take the frontmost Safari tab URL and shorten it, then paste it in the clipboard.

    You could use Applescript Editor to save this as an app if you like then run it from the Dock or Spotlight.

    Code:
    tell application "Safari"
    	set longURL to URL of front document
    end tell
    
    set shellScript to ("curl --url \"http://tinyurl.com/api-create.php?url=" & longURL & "\" ")
    
    set shortURL to (do shell script shellScript)
    
    set the clipboard to shortURL
     
  3. Shawzborne thread starter macrumors 6502a

    Shawzborne

    Joined:
    Jun 12, 2013
    #3
    The best way for this if anyone wants to know is download short menu in the Mac app store
     

Share This Page