• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is There No Limit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Is There No Limit? (From: Luther Fuller <email@hidden>)
 >Re: Is There No Limit? (From: Axel Luttgens <email@hidden>)
 >Re: Is There No Limit? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Is There No Limit?
  • Next by Date: Re: Is There No Limit?
  • Previous by thread: Re: Is There No Limit?
  • Next by thread: Re: Is There No Limit?
  • Index(es):
    • Date
    • Thread