Confirm and proceed

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

maybe i should use “if” to compare clipboard contents before and after retrieval. there must be no genuine way to get the confirmation, right?

Actually AppleScript waits for the result of a shell script before it proceeds

thanks. I wish someday applescript also waits for itself instead of jumping to next line of code before finishing the execution of previous one.