Skip to content

The Eclectic Light Company

Macs, painting, and more
Main navigation
  • Downloads
  • M1 & M2 Macs
  • Mac Problems
  • Mac articles
  • Art
  • Macs
  • Painting
hoakley November 6, 2020 Macs, Technology

Finder Comments: worth avoiding

Finder Comments, also known as Spotlight Comments, are such a good idea. Select a file, Get Info in the Finder, and just type your text into the Comments section. You can then find them again in Spotlight searches, and they’re just a Command-I away. This article looks at their use and shortcomings.

Metadata, information about a file rather than the data in that file, should ideally be strongly attached to the file. That’s what happens when the metadata are file attributes (name, date of creation, etc.), or stored in an extended attribute (Finder Tags and a great deal more). Where systems aren’t able to handle extended attributes, or they may become detached, a second best is to tack the metadata onto the file’s data, which is widely practised in cross-platform document types including images, audio, movies, even styled text like RTF.

Where are they kept?

The worst possible place you can store metadata is in a separate file, such as a hidden file of proprietary format located in the same folder. But that’s exactly where Finder Comments are saved. Worse still, as if recognising the error of its ways, Apple duplicated them in an extended attribute (xattr), only that isn’t kept in sync with the other copy. The end result is that Finder Comments are as reliable as loose scraps of paper, and just as easily lost.

When you add or edit your Finder Comment in the Get Info dialog, the Finder saves your text in two different places:

  • the primary copy goes into the hidden .DS_Store file in the same folder as the document;
  • a secondary copy is saved in a xattr of type com.apple.metadata:kMDItemFinderComment for the file.

I refer to them as primary and secondary because the Finder only seems to know about the first. It’s easy to demonstrate that.

Pick a file and give it a distinctive Finder Comment using the Get Info dialog. Using my free metadata editor Metamer, my full editing utility xattred, or the xattr command in Terminal, inspect that file’s com.apple.metadata:kMDItemFinderComment xattr. You can do that simply in Metamer by opening the file in that app and pasting in com.apple.metadata:kMDItemFinderComment to the upper of the two boxes, a Combo Box, then pressing the Tab key. Alternatively, take my word for it and just select FinderComment in the popup menu there. The lower box should then display the file’s Finder Comment.

—

Edit that comment in a distinctive way, and click Save. The changed xattr will be written to that file’s xattrs, and can be retrieved whenever you wish. But when you Get Info on that file you’ll see that the comment displayed there hasn’t changed at all. That’s because conversion between the hidden .DS_Store file and the file’s xattr is one-way. There’s no syncing in the other direction.

How well are they preserved?

Move a document with a Finder Comment around using the Finder, and you’ll see that comment is quite well-preserved, even if it remains different from the copy held in that xattr. The moment that anything happens to the .DS_Store file – which, being hidden, you can’t readily see – then your Finder Comment just vanishes. This most commonly happens during transit through cloud storage such as iCloud, or non-Mac file systems. Finder Comments are well-preserved by most compression and archiving apps, though.

How to search them

If you do opt to use Finder Comments, you might be puzzled as to how to find them in Spotlight, which supports two different types of comment. They’re there referred to not as Finder Comments, or just Comments, but Spotlight comments, and you’ll have to add them to your criteria for Find operations before you can get Spotlight to search for contents of these comments. Of course, like the Finder, Spotlight ignores what you might have saved to the com.apple.metadata:kMDItemFinderComment xattr and goes entirely on the information hidden in the .DS_Store file. If that’s gone missing for any reason, then Spotlight can’t find your comment, even though it might be saved in a xattr.

Alternatives

Thankfully, macOS provides a much better way of attaching comments to a file, what it calls simply a Comment. These are displayed in the Get Info dialog in the More Info section rather than the Comments, but can’t be edited there. They’re one of the basic types of metadata supported directly by Metamer, where they appear in the Combo Box menu simply as Comment, of the type com.apple.metadata:kMDItemComment, and work fine with Spotlight. I’m not sure what’s preventing Apple from phasing out Finder or Spotlight Comments and moving to regular xattr Comments, nor why Finder Comments in .DS_Store files aren’t synced properly with their xattr. I haven’t asked Apple what’s blocking that choice, after all I’m fairly sure that the response would be “No Comment”.

Further reading:

Wikipedia on .DS_Store files
Wim Lewis’s account of the .DS_Store format
Matthew McCullough’s AppleScript tool to sync from xattr to .DS_Store file

Share this:

  • Twitter
  • Facebook
  • Reddit
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Related

Posted in Macs, Technology and tagged .DS_Store, comment, extended attributes, Finder, metadata, xattr. Bookmark the permalink.

12Comments

Add yours
  1. 1
    Duncan on November 6, 2020 at 3:06 pm

    Over the years I have entered, and ultimately lost so many Finder comments that I no longer trust any information that can’t be seen in the Finder itself. Unfortunately that results in very long file names that now include much of the information, but at least I can count on those being preserved. (right?)

    I am beyond disgusted with how little regard Apple pays to their own file management systems (including my oft-belabored rants about file checksums). Every time Apple announces some new whiz-bang feature at WWDC I roll my eyes and immediately dismiss it. They’re not as bad as Google in terms of feature abandonment, but I’m done second-guessing Apple’s intentions and loyalty to their own technology.

    LikeLiked by 1 person

  2. 2
    David C. on November 6, 2020 at 3:08 pm

    Finder comments have always existed and have always been flaky. They were a part of Mac OS as far back as I can remember – at least as old as System 7, and maybe even 6.

    And they were never reliable. The comments were originally stored in the Desktop file of a volume. And rebuilding the Desktop file (a common cleanup/maintenance activity) on systems prior to 7.5.3 would trash all Finder comments on the volume, making them practically useless.

    Given all their problems, I am quite surprised that Apple didn’t drop this “feature” a long time ago.

    LikeLiked by 1 person

    • 3
      Duncan on November 6, 2020 at 4:27 pm

      I’ve been using Mac OS since the System 6 days and knew the problems, but I think at one point there was a claim that Apple strengthened the Finder Comments’ persistence (around 10.5, maybe?) and started using them. All went well for a few years and then the flakiness started, or maybe they were never robust and I was blithely lucky. At least now Howard has spelled out the full picture so I won’t fall into that trap again.

      I used them mostly for software downloads to notate any idiosyncrasies to be aware of down the road if/when I had to use them for some legacy purpose. For that they were very useful, now those comments are all lost. So instead I now pack them into folders with long filenames that essentially carry those comments instead. What a kludge.

      LikeLiked by 1 person

  3. 4
    Michael Tsai - Blog - Fragile Spotlight Comments on November 10, 2020 at 1:11 am

    […] Howard Oakley: […]

    LikeLike

  4. 5
    Dave on November 11, 2020 at 8:48 pm

    Are Finder file tags saved in any more robust a fashion? Like many, I’ve got years of folder-based organizing in my bones, but it’s not hard to see how tags can be a lot more flexible and powerful. On the other hand, if they’re liable to get stripped out by some glitch, or lost in a backup… I guess it’s better to stick with folders.

    LikeLiked by 2 people

    • 6
      hoakley on November 11, 2020 at 9:58 pm

      Yes: I have recently written about them here. Although they can still get stripped, many Mac backup software including Time Machine and Chronosync, and CCC, preserve them faithfully.
      Howard.

      LikeLiked by 1 person

  5. 7
    sstanleyau on December 10, 2020 at 1:07 am

    Howard, I suspect the Finder is writing the comments to just one place: the .DS_Store. And I suspect the Finder’s Spotlight plug-in is reading it from there when it writes the kMDItemFinderComment metadata. I’m not sure why one would expect changing metadata to affect the data in a file it was originally based on — that would seem the stuff of nightmares.

    LikeLiked by 1 person

    • 8
      hoakley on December 10, 2020 at 6:59 am

      Thank you.
      So why should Spotlight bother to write it to the extended attribute? Indeed, why store this in an extended attribute if that is never going to be read? And if it’s not kept in sync with the file, it only causes conflicts.
      If file metadata isn’t stored reliably with the file, then it’s only going to get lost, as Finder comments so often are. So they’re a complete waste of time.
      Howard.

      LikeLike

      • 9
        sstanleyau on December 10, 2020 at 7:10 am

        First, a correction: I should have said by *a* Spotlight plugin, or the daemon that creates other non-app-specific metadata. I presume it’s being written for the same reason as other metadata: for searches. I guess what I’m trying to say is that it looks to me like the metadata issue is a side-show to the real problem, which is the Finder losing its comments. The metadata being out of sync is simply a symptom of the problem.

        LikeLiked by 1 person

        • 10
          hoakley on December 10, 2020 at 10:40 am

          Thank you. I agree.
          Howard.

          LikeLike

  6. 11
    Ivan Drucker on April 19, 2021 at 9:41 pm

    It sounds like you’ve got more robust tools at hand, but I wrote a simple-purpose AppleScript to bring back Finder comments from their extended attributes. It’s also useful when synchronization clients don’t preserve the Finder comments but they do preserve the attributes (e.g. Dropbox). It’s here: https://www.ivanexpert.com/blog/2020/09/restore-mac-finder-comments/

    LikeLiked by 1 person

    • 12
      hoakley on April 19, 2021 at 10:12 pm

      Thank you – that could be helpful for someone, I’m sure.
      Howard.

      LikeLike

·Comments are closed.

Quick Links

  • Downloads
  • Mac Troubleshooting Summary
  • M1 & M2 Macs
  • Mac problem-solving
  • Painting topics
  • Painting
  • Long Reads

Search

Monthly archives

  • February 2023 (15)
  • January 2023 (74)
  • December 2022 (74)
  • November 2022 (72)
  • October 2022 (76)
  • September 2022 (72)
  • August 2022 (75)
  • July 2022 (76)
  • June 2022 (73)
  • May 2022 (76)
  • April 2022 (71)
  • March 2022 (77)
  • February 2022 (68)
  • January 2022 (77)
  • December 2021 (75)
  • November 2021 (72)
  • October 2021 (75)
  • September 2021 (76)
  • August 2021 (75)
  • July 2021 (75)
  • June 2021 (71)
  • May 2021 (80)
  • April 2021 (79)
  • March 2021 (77)
  • February 2021 (75)
  • January 2021 (75)
  • December 2020 (77)
  • November 2020 (84)
  • October 2020 (81)
  • September 2020 (79)
  • August 2020 (103)
  • July 2020 (81)
  • June 2020 (78)
  • May 2020 (78)
  • April 2020 (81)
  • March 2020 (86)
  • February 2020 (77)
  • January 2020 (86)
  • December 2019 (82)
  • November 2019 (74)
  • October 2019 (89)
  • September 2019 (80)
  • August 2019 (91)
  • July 2019 (95)
  • June 2019 (88)
  • May 2019 (91)
  • April 2019 (79)
  • March 2019 (78)
  • February 2019 (71)
  • January 2019 (69)
  • December 2018 (79)
  • November 2018 (71)
  • October 2018 (78)
  • September 2018 (76)
  • August 2018 (78)
  • July 2018 (76)
  • June 2018 (77)
  • May 2018 (71)
  • April 2018 (67)
  • March 2018 (73)
  • February 2018 (67)
  • January 2018 (83)
  • December 2017 (94)
  • November 2017 (73)
  • October 2017 (86)
  • September 2017 (92)
  • August 2017 (69)
  • July 2017 (81)
  • June 2017 (76)
  • May 2017 (90)
  • April 2017 (76)
  • March 2017 (79)
  • February 2017 (65)
  • January 2017 (76)
  • December 2016 (75)
  • November 2016 (68)
  • October 2016 (76)
  • September 2016 (78)
  • August 2016 (70)
  • July 2016 (74)
  • June 2016 (66)
  • May 2016 (71)
  • April 2016 (67)
  • March 2016 (71)
  • February 2016 (68)
  • January 2016 (90)
  • December 2015 (96)
  • November 2015 (103)
  • October 2015 (119)
  • September 2015 (115)
  • August 2015 (117)
  • July 2015 (117)
  • June 2015 (105)
  • May 2015 (111)
  • April 2015 (119)
  • March 2015 (69)
  • February 2015 (54)
  • January 2015 (39)

Tags

APFS Apple AppleScript Apple silicon backup Big Sur Blake bug Catalina Consolation Console diagnosis Disk Utility Doré El Capitan extended attributes Finder firmware Gatekeeper Gérôme HFS+ High Sierra history of painting iCloud Impressionism iOS landscape LockRattler log logs M1 Mac Mac history macOS macOS 10.12 macOS 10.13 macOS 10.14 macOS 10.15 macOS 11 macOS 12 macOS 13 malware Mojave Monet Monterey Moreau MRT myth narrative OS X Ovid painting Pissarro Poussin privacy realism Renoir riddle Rubens Sargent scripting security Sierra SilentKnight SSD Swift symbolism Time Machine Turner update upgrade Ventura xattr Xcode XProtect

Statistics

  • 13,808,491 hits
Blog at WordPress.com.
Footer navigation
  • About & Contact
  • Macs
  • Painting
  • Language
  • Tech
  • Life
  • General
  • Downloads
  • Mac problem-solving
  • Extended attributes (xattrs)
  • Painting topics
  • Hieronymus Bosch
  • English language
  • LockRattler: 10.12 Sierra
  • LockRattler: 10.13 High Sierra
  • LockRattler: 10.11 El Capitan
  • Updates: El Capitan
  • Updates: Sierra, High Sierra, Mojave, Catalina, Big Sur
  • LockRattler: 10.14 Mojave
  • SilentKnight, silnite, LockRattler, SystHist & Scrub
  • DelightEd & Podofyllin
  • xattred, Metamer, Sandstrip & xattr tools
  • 32-bitCheck & ArchiChect
  • T2M2, Ulbow, Consolation and log utilities
  • Cirrus & Bailiff
  • Taccy, Signet, Precize, Alifix, UTIutility, Sparsity, alisma
  • Revisionist & DeepTools
  • Text Utilities: Nalaprop, Dystextia and others
  • PDF
  • Keychains & Permissions
  • LockRattler: 10.15 Catalina
  • Updates
  • Spundle, Cormorant, Stibium, Dintch, Fintch and cintch
  • Long Reads
  • Mac Troubleshooting Summary
  • LockRattler: 11.0 Big Sur
  • M1 & M2 Macs
  • Mints: a multifunction utility
  • LockRattler: 12.x Monterey
  • VisualLookUpTest
  • Virtualisation on Apple silicon
  • LockRattler: 13.x Ventura
Secondary navigation
  • Search

Post navigation

Apple has released Catalina 10.15.7 Supplemental Update
News for those who follow this blog by email

Begin typing your search above and press return to search. Press Esc to cancel.

  • Follow Following
    • The Eclectic Light Company
    • Join 3,137 other followers
    • Already have a WordPress.com account? Log in now.
    • The Eclectic Light Company
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: