Code: Select all
do fld "A" as appleScript
tell application "Safari"
set myURL to URL of document 1
return myURL
end tell
The only prob is that if the button is pressed and fld A script is run without a browser window open, it causes an error.
So my question is: how do I script using Applescript an if then statement

i.e (pseudocode included)
tell application "Safari"
if document 1 is open then
set myURL to URL of document 1
return myURL
else
exit tell application
end if
end tell
And I've a second question: how do I script in the above text-that-will-be-code:
tell application "Safari" or "FireFox" or "Opera" or Netscape Navigator" or "Camino" whichever is open ----(psedocode, of course!)

Any help appreciated, please.
