I want a confirmation if the script actually retrieved a short url from metamark.net. Because i want to use the keystroke “cmd + v” to paste the clipboard after the script puts the short url on the clipboard. Setting a delay would not be a very good idea. By the way, “confirmation” does not mean that i want any visual or audio feedback. It should be only for the script so that it knows whether to proceed forward or not.
tell application "Firefox"
set longURLlll to properties of front window as list
set longURL to item 3 of contents of longURLlll
end tell
--you can try it for Safari by changing the above code
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