• 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: True-False vs True-Error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: True-False vs True-Error


  • Subject: RE: True-False vs True-Error
  • From: Scott Babcock <email@hidden>
  • Date: Sun, 12 Oct 2008 12:32:42 -0700
  • Acceptlanguage: en-US
  • Thread-topic: True-False vs True-Error

Try adding the predicate "a reference to" to your code. This should insulate you from the error:

       tell application "Finder"
               exists a reference to application file id "com.unknown.something"
       end tell

________________________________________
Date: Sun, 12 Oct 2008 09:13:07 -0700
From: Michelle Steiner <email@hidden>
Subject: Re: True-False vs True-Error
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes

On Oct 12, 2008, at 8:04 AM, Luther Fuller wrote:

> he Finder's 'exists' command is defined in the Finder's dictionary
> as having a Boolean result.
> To quote: "??? boolean : true if it exists, false if not"
>
> But this code does not have that behavior ...
>
>       tell application "Finder"
>               exists application file id "com.unknown.something"
>       end tell
>
> It does return true if it exists, but returns error -10814 if it
> does not exist.

You get the same error without "exists" in the script.  That means
that the error happens before the script gets to evaluate "exists".

-- Michelle

--
"What we have in this country is socialism for the rich and free
enterprise for the poor."  -- Gore Vidal




------------------------------

_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users

End of AppleScript-Users Digest, Vol 5, Issue 558
*************************************************

 _______________________________________________
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

  • Follow-Ups:
    • Re: True-False vs True-Error
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: True-False vs True-Error
  • Next by Date: Re: True-False vs True-Error
  • Previous by thread: Re: True-False vs True-Error
  • Next by thread: Re: True-False vs True-Error
  • Index(es):
    • Date
    • Thread