Re: Checking if a variable is defined
Re: Checking if a variable is defined
- Subject: Re: Checking if a variable is defined
- From: Richard Rönnbäck <email@hidden>
- Date: Sat, 02 Aug 2008 16:59:27 +0200
- Thread-topic: Checking if a variable is defined
set IsDefined to true
try
get theVariable
on error
set IsDefined to false
end try
if IsDefined then
say "it is defined"
else
say "it is not defined"
end if
> Från: Jan Erik Moström <email@hidden>
> Datum: Sat, 2 Aug 2008 16:30:57 +0200
> Till: <email@hidden>
> Ämne: Checking if a variable is defined
>
> 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:
> edband.net
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
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