20071124

Camino Metamark AppleScript

It seems that Metamark is the new TinyURL.

Since I can’t really like Safari, I hacked a slightly different version of Jason Snell's AppleScript in order to use it with my browser of choice.

So, without further ado, here it is:

tell application "Camino"
 set longURL to URL of current tab of window 1
end tell

set shellScript to ("curl --url \"http://metamark.net/api/rest/simple?long_url=" & longURL & "\" ")

set shortURL to (do shell script shellScript)

set the clipboard to shortURL

This AppleScript should get the url of the active tab in your frontmost window in Camino, pass it to Metamark and insert the shortened version in the clipboard, ready to be pasted.

Please keep in mind that it is my first ever AppleScript, so I cannot guarantee that it works on your system, nor help you debug it.

Nessun commento:

Posta un commento