Re: Is There No Limit?
Re: Is There No Limit?
- Subject: Re: Is There No Limit?
- From: Luther Fuller <email@hidden>
- Date: Sun, 18 Mar 2012 18:22:43 -0500
On Mar 18, 2012, at 5:16 PM, Shane Stanley wrote: On 19/03/2012, at 2:03 AM, Axel Luttgens wrote: do shell script "/usr/bin/mdls -raw -name kMDItemFinderComment ~/Desktop/a.txt"
I don't think that command is actually reading the Finder comments. I'm pretty sure the comments live as attributes in the file's resources file, and presumably a Spotlight import filter then reads them into the Spotlight database where can be used for Spotlight searches. So I think what you're seeing is a limitation on either the filter, or (more probably) the Spotlight database.
As I mentioned, I have a problem where text is written to a message file's comment, but in one instance in a thousand, it does not appear. When that happens, I repair the comment with this script ...
quoted form of (POSIX path of msg) do shell script "mdls -name kMDItemFinderComment " & the result set msgComment to the result as text set msgComment to (text 25 thru -2 of msgComment) if (msgComment = emptyQuotes) then set comment of msg to "*" else if (length of msgComment) = 0 then set comment of msg to "*" else set comment of msg to msgComment end if
In every case, this code repairs the problem and restores the correct comment. (Setting the comment to "*" is there in case I encounter a file such as a pdf whose comment has never been written.)
My conclusion is that writing a comment writes both the Finder's Comment and the metadata 'kMDItemFinderComment', but in one instance/1000, the Finder's Comment gets lost. The value of kMDItemFinderComment is always written correctly.
|
_______________________________________________
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