Re: True-False vs True-Error
Re: True-False vs True-Error
- Subject: Re: True-False vs True-Error
- From: has <email@hidden>
- Date: Mon, 13 Oct 2008 18:31:10 +0100
Luther Fuller wrote:
The 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.
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?
It's a bug in Finder. -10814 is a Launch Services error: "No
application in the Launch Services database matches the input
criteria." Finder's 'exists' command should catch this error and
return 'false' - that's its purpose.
https://bugreport.apple.com/
HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
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