On Mar 21, 2009, at 10:38 AM, Steve Cronin wrote:

The 'theScript' is a valid script that executes flawlessly in 'Script Editor':
tell application "Finder"
        try
                comment of file ("/Users/steve/...." as POSIX file)
        on error
                return "Error"
        end try
end tell

It sounds like you've solved your problem, but I'd just note that if you're only getting Finder comments, MDItem is faster and simpler:

- (NSString *)commentForURL:(NSURL *)fileURL;
{
    NSParameterAssert([fileURL isFileURL]);

    MDItemRef mdItem = NULL;
    CFStringRef path = (CFStringRef)[fileURL path];
    NSString *theComment = nil;

    if (path && (mdItem = MDItemCreate(CFGetAllocator(path), path))) {
theComment = (NSString *)MDItemCopyAttribute(mdItem, kMDItemFinderComment);
        CFRelease(mdItem);
        [theComment autorelease];
    }
    return theComment;
}



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to