• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Checking if a variable is defined
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking if a variable is defined


  • Subject: Checking if a variable is defined
  • From: Jan Erik Moström <email@hidden>
  • Date: Sat, 2 Aug 2008 16:30:57 +0200

It's been some time since I did any Applescripting and now I can't figure out how to check if a variable exists or not.

I have this script

tell application "OmniWeb"
    tell first browser
        set webName to name
        set webURL to address of active tab
    end tell
end tell

and if the currently active tab doesn't contain a web page the webURL is undefined after the tell statement is executed (it doesn't help if I define webURL before the tell app, it's undefined after the script). But I can't figure out how to check if webURL exists or not. Can anyone tell me how to do this?

                    jem
--
Jan Erik Moström, www.mostrom.pp.se

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Checking if a variable is defined
      • From: Michelle Steiner <email@hidden>
    • Re: Checking if a variable is defined
      • From: Richard Rönnbäck <email@hidden>
  • Prev by Date: Re: Alias Files
  • Next by Date: Re: Checking if a variable is defined
  • Previous by thread: Re: Keywords in Aperture
  • Next by thread: Re: Checking if a variable is defined
  • Index(es):
    • Date
    • Thread