Re: True-False vs True-Error
Re: True-False vs True-Error
- Subject: Re: True-False vs True-Error
- From: Luther Fuller <email@hidden>
- Date: Mon, 13 Oct 2008 07:32:05 -0500
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.
_______________________________________________
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