Re: Checking if a variable is defined
Re: Checking if a variable is defined
- Subject: Re: Checking if a variable is defined
- From: Michelle Steiner <email@hidden>
- Date: Sat, 2 Aug 2008 10:06:05 -0700
On Aug 2, 2008, at 7:30 AM, Jan Erik Moström wrote:
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?
How about this?
set webURL to missing value
tell application "OmniWeb"
tell first browser
set webName to name
if address of active tab is not missing value then
(*
if the above line does not return missing value if there is no
address in the active tab, then change "missing value" to whatever is
returned.
*)
set webURL to address of active tab
else
-- do whatever is needed for no URL in the tab
end if
end tell
end tell
I don't have OmniWeb so I can't compile it, let alone test it.
-- Michelle
--
Please contribute to the Leukemia and Lymphoma Society, and help me
meet my fund raising goal for my marathon training.
<http://www.active.com/donate/tntdms/tntdmsMSteine>
_______________________________________________
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