Posted By

nick108 on 09/14/10


applescript productivity bitly textexpander

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite



 / Published in: AppleScript

You need to replace [replacewithbitlyusername] and [replacewithbitlyapi_key] to make this snippet work. Test in AppleScript code editor if you're experiencing problems in TextEpander such as the snipped being output instead of the URL

  1. set the ClipURL to (the clipboard as string)
  3. ignoring case
  4. if ((characters 1 through 4 of ClipURL as string) is not "http") then
  5. return "Malformed URL."
  6. else
  7. set curlCMD to ¬
  8. "curl --stderr /dev/null \"" & ClipURL & "&login=[replace_with_bitly_username]&apiKey=[replace_with_bitly_api_key]" & "\""
  10. -- Run the script and get the result:
  11. set tinyURL to (do shell script curlCMD)
  13. return tinyURL
  14. end if
  15. end ignoring

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Jacky888 on October 17, 2018

general mobile etab5 gofirmware

You need to login to post a comment.