How to see all Spotlight comments?

Discussion in 'macOS' started by reubs, May 4, 2010.

  1. reubs macrumors 68000

    Jun 22, 2006
    Long ago I tried using Spotlight comments, and I never got into the habit that I needed to. I'm thinking again of using a tagging program that will autocomplete and catalog tags for me, but first I want to clear out all my current Spotlight comments.

    What's the best way to find out what files have Spotlight comments associate with them, and then what's the best way to delete those comments? I know it's not too many files, and I don't want to taint any future workflows with bits from the past.
  2. mysterytramp macrumors 65816


    Jul 17, 2008
    Use AppleScript

    set myFolder to choose folder
    tell application "Finder"
    	set theCommented to items of myFolder whose comment is not ""
    	repeat with oneFile in theCommented
    		set oneName to name of oneFile
    		set oneComment to comment of oneFile
    		display dialog "Comment for " & oneName & ":" & return & oneComment
    	end repeat
    end tell
    This should get you started.

  3. reubs thread starter macrumors 68000

    Jun 22, 2006
    It was actually easier than that; I knew I didn't have any kind of catalog for my comments, so I didn't need to worry about preserving them. I ran an Automator action to Get a Specified Finder Item; to Get Folder Contents; and then to set the Spotlight comment to *blank*, overwriting what was already there. I don't know why I didn't think of that, but it took care of it all.

    Thanks, though, for sharing the Applescript!

Share This Page