Re: Checking on the existence of a file
Re: Checking on the existence of a file
- Subject: Re: Checking on the existence of a file
- From: Christopher Nebel <email@hidden>
- Date: Sat, 05 Jan 2013 16:56:23 -0800
On Dec 4, 2012, at 3:24 AM, Shane Stanley <email@hidden> wrote:
> I think leaving off the parentheses is roughly equivalent to using key-value coding -- like using 'valueForKey_("isAbsolutePath")' or 'valueForKey_("absolutePath")'. ...
It is in fact precisely equivalent to KVC: "propertyname of object", or the equivalent "object's propertyname", invokes [object valueForKey:propertyname]. (Assuming the object responds to -valueForKey:, that is, but anything descended from NSObject does.)
> On 04/12/2012, at 8:14 PM, Harald E Brandt <email@hidden> wrote:
>
>> I actually think that it would have been much better to not even allow omission of those parentheses, since you never know what a future version of OS X might do with that syntax.
>
> If it is a KVO thing, be careful what you wish for...
It would actually be hard, not to mention probably incorrect, to make omitting the parentheses *not* work for methods like -isAbsolutePath, since Objective-C doesn't really distinguish between parameter-less methods and properties.
--Chris Nebel
AppleScript Engineering
PS: The variance in the return values seems strange to me; I'll have to look into it.
_______________________________________________
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