Re: Test for valid URL?
Re: Test for valid URL?
- Subject: Re: Test for valid URL?
- From: Steve Thompson <email@hidden>
- Date: Thu, 16 Sep 2010 11:38:19 +0100
On 16 Sep 2010, at 01:48, Michael Grant wrote: Does AppleScript provide any way of testing whether a string is a valid URL before using it as the argument of the "open location" command?
A couple of other people have mentioned that the word "valid" is ambiguous but for "standard" URLs this works
try on error display dialog "No a valid URL" end try
If curl can't resolve the url it returns an error which AppleScript's try statement can catch.
Steve |
_______________________________________________
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