Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

reubs

macrumors 68000
Original poster
Jun 22, 2006
1,891
215
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.
 
Use AppleScript

Code:
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.

mt
 
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.