Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use Automator to batch add Spotlight comments System 10.4
Tiger only hintAfter installing 10.4, I noticed that every file now has a Spotlight Comments field attached to it (visible in the Get Info window), and was regretting that most of my existing files don't have comments. It's one thing to put comments on files as they are created, but to go back through and put information about which project or whatever files should be indexed with for the thousands of files already on my computer, wow, what a pain. On the other hand, like many people, related files are often in related locations. This means you can use Automator to batch-add comments to files in related locations. Just use the following sequence:

Ask for Finder Items
Get Folder Contents
Add Spotlight Comments to Finder Items

You will probably want to use the "Repeat for each subfolder found" option for Get Folder Contents. The only problem I have is I can't figure out how to get Automator to let me dynamically update the contents of the Spotlight comments I'm adding each time I run the workflow. Instead, I have to modify the appropriate field in the workflow before I run it each time.
    •    
  • Currently 2.00 / 5
  You rated: 3 / 5 (4 votes cast)
 
[14,868 views]  

10.4: Use Automator to batch add Spotlight comments | 11 comments | Create New Account
Click here to return to the '10.4: Use Automator to batch add Spotlight comments' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Automator to batch add Spotlight comments
Authored by: valx on May 17, '05 11:13:49AM

I have previously tried this, and ran into one problem. When I used "Repeat for each subfolder found", it would not update the comments field of the subfolders it found--only the comments of the contents of the subfolder. Anyone else had this problem?



[ Reply to This | # ]
Custom Spotlight comments each time workflow is run
Authored by: cbseven on May 17, '05 11:24:16AM

In your "Add Spotlight Comments to Finder Items" action, click "Options" and specify to "Show Actions When Run". This will bring up a dialog each time the workflow is run and allow you to modify the Spotlight comments.



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: davidduff on May 17, '05 12:39:26PM

how are spotlight comments stored? are they stored in a separate "fork" of the file? if so, is the information preserved when files are copied/moved?

i seem to remember that some backup utilities (retrospect is the one i am particularly interested in) don't preserve this kind of info yet. can anyone confirm? i presume it won't be too hard for them to fix this problem.

seems like it would be a shame if people spend lots of time creating and updating metadata only to find that it's wiped out later.

i seem to remember something like this happening before with finder "get info" comments. most people i know who used these learned not to rely on them for anything important.



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: luhmann on May 17, '05 02:34:31PM

I was wondering the same thing. I saw this:

http://www.sauria.com/blog/2005/05/12#1301

which seems to suggest that it will all be lost if you swap hard drives or restore from a backup, etc.



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: Tom Robinson on May 17, '05 07:45:08PM

Spotlight comments seem to be the old Get Info comments renamed and the same under the covers: i.e Retrospect and StuffIt don't save them, and the Finder loses them on a fairly regular basis.

They're stored somewhere external to the file, not the resource fork, hence their transient nature (under OS 9 it was somewhere in the file metadata, OS X it's in the .DS_Store files).

Pity. I've always liked them but they never stick around.

Where possible I now store comments in the files themselves (IPTC data for photos, document properties for NeoOffice/J), or in small text files.



[ Reply to This | # ]
All Metadata is saved with the file (in forks)
Authored by: PopMcGee on Jun 13, '05 12:23:02PM

All metadata is saved as part of the file and automatically copied along on HFS+ volumes. Only when using strange filesystems like FAT (MS-DOS), ._ files are created. Unless your backup utility uses nonstandard ways of copying things, all your metadata should be kept intact.

Read more about this here:
http://arstechnica.com/reviews/os/macosx-10.4.ars/7



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: CanMixShots on May 17, '05 03:25:50PM

As far as I know, Finder comments, aka known as Spotlight comments in Tiger, are stored in the invisible .DS_Store file which is in every folder. So I guess backing up to a DVD or CD or another disk doesn't mean we will have to lose them, as long as we don't deliberately delete those invisible files, or choose to ignore them in whatever software we are using to backup or copy. Please correct me if I'm wrong.



[ Reply to This | # ]
You're wrong.
Authored by: PopMcGee on Jun 13, '05 12:24:24PM

All metadata is saved as part of the file and automatically copied along on HFS+ volumes. Only when using strange filesystems like FAT (MS-DOS), ._ files are created. Unless your backup utility uses nonstandard ways of copying things, all your metadata should be kept intact.

Read more about this here:
http://arstechnica.com/reviews/os/macosx-10.4.ars/7



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: cafemomo on May 18, '05 06:24:48AM

Alternatively, in Automator, do the following workflow:

1. Finder > Get Selected Finder Items
2. Spotlight > Add Spotlight Comments to Finder Items
(keep append to existing comments checked, and open the options disclosure area and check 'Show Action When Run' so you can set comments each time)

Finally in Automator, go to File > Save as Plug-in..., enter "Add Spotlight Comments" as the "Save Plug-in As:" name, and make sure "Plug-in for:" is set to "Finder". Hit Save and close Automator (if it asks you to save again, do so)

Now in Finder, select some items you want to add comments to and right-click (or control-click) and select "Add Spotlight Comments" from the "Automator" submenu.

Job done. You can also add file renaming options and so on to Finder right-click actions. This is all demonstrated in the Automator demo movies on apple.com by the way.



[ Reply to This | # ]
10.4: Use Automator to batch add Spotlight comments
Authored by: Arlo on May 18, '05 08:52:33AM
Those are great tips. The SuperMega workflow here takes all this to a crazy extreme, it's worth checking out.

[ Reply to This | # ]
keyword for Identifying pdfs that aren't searchable/indexable?
Authored by: gmehl on Jun 17, '05 11:00:45AM

Hopefully this isn't too far off topic.... but does anyone know if there is a keyword or something else in metadata that indicates whether a PDF file is text searchable? I have a lot of articles that are in pdf format but are images (someone scanned them and then didn't "capture OCR" the text") so they are not searchable with spotlight excepting their filename.

I would love to know if there is a metadata tag somewhere that would aid me in identifying these files so that I could then OCR just these limited number of documents. Applescript anyone?

Thanks,

Garrett



[ Reply to This | # ]