• 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
Re: script won't compile if object doesn't exist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: script won't compile if object doesn't exist (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: setting the list view on a folder
  • Next by Date: Re: script won't compile if object doesn't exist
  • Previous by thread: Re: script won't compile if object doesn't exist
  • Next by thread: Re: script won't compile if object doesn't exist
  • Index(es):
    • Date
    • Thread