A lazy man’s guide Smart Folders and Labels

I never really used Smart Folders in OS X, just as I never really cared about labels or stationery pads.

A lot of Mac users don’t even know what these things are. In fact I assume most don’t know. But it’s really not some obscure diabolical ritual. Just select a file and hit ⌘I
What the labels do should be pretty self-explanatory. A stationery pad is comparable to templates you might know from Microsoft Office. When you open a file that’s that has this checkbox checked, it won’t open this file but instead open a copy of it. You could use it to create some empty forms that are due each month and require different values.
wpid-PastedGraphic3-2010-10-31-09-44.tiff
I created a folder with a couple of files defined as stationery pads just for the sake of it and I still ended up not using them because I forgot to put them there. Until the day I stumbled over the command line app called mdls I just couldn’t make use of it. mdls is part of OS X and all it does is to list the metadata attributes for the specified file (that’s right, that’s straight from the man page). I noticed that there were attributes listed not only specifying that file as a stationery pad but also a number that represented its colour label. That just had to be a useful discovery, if you could only make Spotlight look for those. You can.

wpid-PastedGraphic6-2010-10-31-09-44.tiff

Using mdls on a file lists the attributes like this

kMDItemFSIsStationery          = 1

Spotlight won’t find anything if you search for it though, so one has to make a tiny adjustment

kMDItemFSIsStationery:1

wpid-PastedGraphic1-2010-10-31-09-44.tiff

Colour labels are specified by the value of the kMDItemFSLabel-entry. These are the values they have on my machine but if you made any adjustments to it, the numbers might be different so you better use mdls to determine values:

  • grey =
  • green = 2
  • purple = 3
  • blue = 4
  • yellow = 5
  • red = 6
  • orange = 7

So in order to list “All Red”-items you have to search for

kMDItemFSLabel:6

wpid-PastedGraphic2-2010-10-31-09-44.tiff

You might also like

  • You might also like

Comments are closed.