Mavericks meets Hazel (Noodlesoft)

Bearboat Software Logo
Bearboat Software


Let There be Light

Mavericks, Tags, Labels & Hazel

Tags are a new feature of Mavericks. Labels no longer exist (but they sort of do under the hood). Tags and labels are not the same thing.

Both tags and labels are associated with individual files or folders. They have that in common.

For the people that were using labels in the previous versions of OSX, Apple has done the following to ease the transition to Mavericks. All the files or folders that were labeled in earlier versions are now tagged with one of seven tags.

  1. Blue
  2. Gray
  3. Green
  4. Orange
  5. Purple
  6. Red
  7. Yellow

Tags, any tag, can be associated with a color in Mavericks. The colors that are available are the same colors that were available for labels in the older versions of the operating system. You cannot create a new and different color for a tag.

Not surprisingly, by default the Blue tag is associated with the color blue, the Gray tag is associated with the color gray, the Green tag is associated with the color green, etc.

These seven tags have been created by Apple and installed as a default with Mavericks. They do not appear to the user to be in anyway special. Like all tags, they can be removed from the entire system. Their color can be changed. (For example, a user could change his Red tag so that its color is actually blue!)

Tags and Labels are different animals.

  1. Only one label could be associated with a given file or folder. Multiple tags can be associated with a file or folder.
  2. Tags can be created or destroyed by the user and given any name by the user and given any available color by the user. Labels were immutable. Their names and color could not be changed.
  3. There were seven labels. No more and no less. You can have unlimited number of tags in the system because the user can create them. You can have fewer tags in the system because the user can remove them, including the default Blue, Red, Gray etc. tags. The seven labels were forever.
  4. Labeled files and folders could be distinguished because their title was generally shown with the associated background color. In Mavericks, files that have been associated with colored tags are displayed with a fairly small colored circle next to the title. This tends to be less conspicuous.
  5. It is possible to associate a file or folder to an uncolored tag. That is, in fact, the default for a new tag. There are extra steps involved to make the tag colored. Files associated only with uncolored tags look in the Finder exactly like an untagged file or folders. There is no “uncolored” circle adjacent to the label. There was no “uncolored” label in earlier versions of OSX. You could remove a label from a file or folder but you could not decolorize a label.

Since you can have many tags associated with a file or folder, a question arises. How are such files displayed? If only one of these tags is associated with a color, that color is displayed in the small circle near the title. If there are two or three tags that are associated with different colors assigned to that file, those files are shown with overlapping colored circles near their title. If there are more than three such tags with more than three colors, only three overlapping circles are shown. I do not know what determines which three colors are selected to display.

Hazel

Hazel is an brilliant utility that allows the user to run scripts on the contents of folders. Before Mavericks, Hazel allowed scripts to apply a label to a file, change the label on a file and to remove a label from a file. It was also “aware” of labels associated with a file so “decisions” could be made in the script based on which label was applied to the file.

Mavericks requires some changes. Hazel has already introduced new features associated with tags. But what about labels?

On the “decision” side pre-Mavericks Hazel allowed you to select files labeled with any specific color. On the “action” side, Hazel allowed you to remove or change the label on a file.

What does that mean now? If your scripts use these old “label” capabilities, how does it work? On the decision side, looking for a red label will match any file labeled with any tag that is associated with the color red not just the Red tag.

On the action side, it is more complicated. If you were asking to set a color label to a different color or remove it, what will happen?

Lets say a user has created a tag “receipt” associating that tag with the color red and a second tag, “food”, associated with the color blue, and a third custom tag “hardware”, which is not associated with any color.

Consider the following three files

  1. A file has been associated with the tag “receipt” and the tag “hardware”. It will have red circle next to it because one of its two tags is associated with the color red.
  2. A second file is associated just with the tag “Red”. It will also have a red circle shown next to it.
  3. A third file is associated with the tag “receipt” and the tag “Red”. It will appear nearly identically in the Finder, but it will show two overlapping red circles next to it.

Now the script asks to remove the color label. All tags of a file that have any color associated with them will be removed. Therefore, the second and third files will end up with no tags. The first file will retain the hardware tag.

What if the user asks to Set color label to blue? Hazel will remove all differently colored tags from the files in the folder and replace them with all of the user created tags that happen to be blue including the tag Blue that Mavericks creates by default. The result will be the first file ends up with the tags hardware, food and Blue. The second and third files will end up with the tags food and Blue.

The developer has come up with a consistent solution that is not too hard to understand. This is the best part of the decision. You can predict what will happen. On the other hand, the results might be considered bizarre depending how you use colored tags. Comprehendible, yes, and that is very important in creating Hazel rules. But bizarre in some contexts. Realize that when you Set the color to Orange you are not only adding the Orange tag and any other custom orange colored tags you have created, but you are also getting rid of all tags that have some color other than orange. The uncolored custom tags survive.

In fact, in my own use, I will avoid coloring my custom tags to avoid dealing with having more than one tag associated with any given color. I will just have the Blue, Orange etc. tags that are created with the Mavericks install. I can, in this fashion, "perserve" the logic of colored labels of yore. I will not be dealing with multiple colored circles next to my file titles with no definitive way of predicting which colors they will be. I will not have multiple tags being removed and added (because they are colored) simply by issuing the Set color rule.

Currently there is no Hazel command to remove all the tags on a file. This seems to create a work around. First run Add tag and select Orange while selecting the Remove all other tags option. That rule will result in the file having the single tag Orange no matter what it started with. Then run the rule Set Color to X (i.e. no color) and that single Orange tag will be removed. Now the file has no tags.