Re: True-False vs True-Error
Re: True-False vs True-Error
- Subject: Re: True-False vs True-Error
- From: "Nigel Garvey" <email@hidden>
- Date: Mon, 13 Oct 2008 12:25:00 +0100
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.
NG
_______________________________________________
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