Re: script won't compile if object doesn't exist
Re: script won't compile if object doesn't exist
- Subject: Re: script won't compile if object doesn't exist
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 11 Aug 2006 17:15:42 -0700
- Thread-topic: script won't compile if object doesn't exist
On 8/11/06 5:00 PM, "Michelle Steiner" <email@hidden> wrote:
>
> On Aug 11, 2006, at 4:54 PM, Robert Poland wrote:
>
>> This script works fine if "Stuff " exists but if it doesn't exist
>> then it won't even compile. It will be for ejecting a link to a
>> secure Folder in the evening.
>>
>> Seems like I saw the answer recently, but like everything else I
>> can't recall it.
>
> If an alias doesn't exist, the script won't compile.
>
> Try using "disk" instead of "alias"
Or another way is to use a variable. But your 'if' clause is faulty and
needs to be fixed. The following both compiles and runs without error (i.e.
does nothing) if the alias doesn't exist.
set stuffItem to "Stuff :"
tell application "Finder"
if exists (alias stuffItem) then eject (alias stuffItem)
end tell
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden