• 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: Philip Aker <email@hidden>
  • Date: Mon, 13 Oct 2008 05:43:58 -0700

On Oct 13, 2008, at 5:32 AM, Luther Fuller wrote:

On Oct 13, 2008, at 6:25 AM, Nigel Garvey wrote:

Luther Fuller wrote on Sun, 12 Oct 2008 10:04:08 -0500:

	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.
A boolean result should return true or false, not true or error.
Easily fixed with a try block, but why should that be necessary?
Is there a bug hiding here?

For what it's worth, I get the same error on my Tiger machine but the
expected behaviour on my old Jaguar one, so it could be a bug. My guess
is that 'exists' is set up to catch error number -1728 ("Can't get
application file id \"com.unknown.something\"."), so error number -10814
is getting past it.


On the other hand, ASLG says that the ID reference form can only be used
with objects that have an ID property. Finder files have no such
property, so the fact that the construction does work when the file
exists is hard to explain.


But, the Finder's dictionary says ...

application file n [inh. file > item] : every application file
...
properties
id text, r/o : the bundle identifier or creator type of the application


which lead me to my code.

kLSApplicationNotFoundErr = -10814, /* E.g. no application claims the file*/


So it's actually not getting past "application file id "com.unknown.something".
There are no notes in the header file about when this error number was introduced however it looks like a number of behaviors were changed as of 10.3



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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
References: 
 >Re: True-False vs True-Error (From: "Nigel Garvey" <email@hidden>)
 >Re: True-False vs True-Error (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: True-False vs True-Error
  • Next by Date: Re: adressbook group trouble
  • Previous by thread: Re: True-False vs True-Error
  • Next by thread: Re: True-False vs True-Error
  • Index(es):
    • Date
    • Thread