Tagging Files in macOS

By mehgcap, 24 January, 2014

What Are Tags?

Starting in macOS 10.9 Mavericks, files could be given one or more "tags", to help users keep things organized. A tag is simply a text label you can assign to a file, letting you organize your files with categories instead of, or in addition to, folders. For example, a student might have a science folder, holding a textbook, handouts, tests, notes, assignments, research papers, and more. What if a quiz deals with thermodynamics, as do some files of notes and a paper. Do you put them into folders according to subject, or according to what sort of document they are (quiz, notes, paper)? With tags, you can have both. Just tag all the thermodynamics files with a "thermodynamics" tag, the notes with a "notes" tag, and so on. Now you can find all your notes, all your thermodynamics notes, all your work related to thermodynamics… You get the idea. Imagine this categorization across all your files--no more wondering which folder into which you dropped a file, no having several folders open just to see all the files for a project, no trying to come up with the exact search rules to make a smart folder hold the files you want. Just tag your files. Oh, and tagging works on iCloud files as well, so even if you don't have that spreadsheet stored in your finances folder, but rather in iCloud so you can edit it with your iPhone whenever you spend money, no problem. Tag it and all your other personal finance files, and everything can be grouped together when you need it to be.

To be clear, this is not the same as tagging media files in iTunes or ID3 editors. ID3 tags are a feature of music files only, while iTunes tagging and library management happens mostly in an XML file. Tags made in Mavericks for files are stored as part of each file, not in a central location like iTunes or Photos. This means that any tagging you might have done in iTunes will not automatically create tags that macOS can work with. On the plus side, the lack of a single file managing all these tags and relationships is that backup services like Time Machine, Crashplan, or Carbonite will automatically back up your tags when they back up your files. After all, the Mac stores tags as meta data for files, just like it stores the date the file was edited or other information. That means that any backup service which backs up a file will also back up the file's tags.

Okay, So How Do I Do This?

Tagging is simple,. There are three ways you can add tags:

  1. When you save a document for the first time, you will notice a text field called "tags". Voiceover makes a sound--a version of the popover noise--when you enter this field. Type your tags there (see below) and that's it.
  2. Navigate to a file in Finder and go to the File menu (vo-m, right arrow to file, down arrow). Select "Tags" from this menu and you are placed in a tag editor, which I will discuss in a moment.
  3. Navigate to a file in Finder and press command-i. After the name, size, and other information is a text field for editing that file's tags.

The Tag Editor

When you invoke the "Tags" option from Finder's File menu, you are placed in the Tag Editor. Focus is set to a text field by default, and here is where you enter your tags. As you type, macOS tries to guess which tags you might be going for. Just as with suggestions in other parts of the Mac, you can use the up and down arrows to move through the suggestions. When you find one you want, hit right arrow, or keep typing if the tag you are trying to use is not found or does not yet exist. Note that tags will appear as "embedded text" items, much like contact names in email fields in the native Mail client. This is why you must press the right arrow to use a suggested tag--doing so moves your cursor past the suggested text and enters it for you.

Once you have typed or selected the tag to be used, press comma. Tags can contain spaces, so macOS needs a delimiter to separate tags, and commas are what it uses. Your instinct may be to press enter, or even space or escape, but the comma is the key, at least in my tests. If I failed to press comma, even if I was only entering a single tag, I might end up with a different tag or no tag at all, and enter failed to close the Tag Editor in some cases. With that comma, all was well.

If you have no idea which tag(s) to use, or want to be reminded of what you have used in the past, vo-right to the table. This lists all the tags you have on your Mac, including some colored ones and some that macOS comes with by default. Unfortunately, the only way to add a tag from the table seems to be with the mouse. Move to the tag you want, route your mouse to it with vo-command-f5, and press vo-shift-space to simulate a mouse click. (If you have a mouse handy, or are using a macbook, you can simply perform a single click). Nothing else I tried will add the tag from the table to the text field, and wow did that sentence have a lot of T words!

Once you have added the tags you want, press enter to save and close the dialog. There is no actual button to that effect, but enter will do it. Escape, as you probably guessed, will close the dialog without saving anything.

Tag Input Fields Elsewhere in OS10

As mentioned above, tags can also be entered when you first save a document, or by opening the information window of a file. The auto suggestions, commas, and other rules apply here as well. The difference is that there is no table listing all your tags, so you must go from memory and the suggestions made as you type.

Using Tags

Now that you have everything assigned to tags, how do you actually use them to view different categories of files? There are a few ways.

  • Finder search: in Finder, press cmd-f. Type any search terms you want, using "tag:" to search for tags. For example, this search will find all files tagged "finance" with the word "receipt" in the name:
    receipt tag:finance
    Press cmd-w to close the search window when you are done, or hit the "Save" button to save the search as a folder so you can come back to it.
  • Smart Folder: make a smart folder and specify which tag(s) should be included/excluded/etc. I will not cover that procedure in detail here as the process is fully accessible and there are a plethora of tutorials online already.
  • Spotlight: invoke Spotlight Search in the usual way (command-space by default) and do a search for "tag:[tag name]". Omit the quotes, and substitute [tag name] for the tag you want to find. Additional search operators are available, of course, but again, details on searching with Spotlight fall outside of the scope of this guide.
  • The Sidebar: if your Finder does not have a Sidebar table, press cmd-shift-s. At the bottom of this table is an item called "Tags", which you can expand to see a list of all the tags on your Mac. Simply arrow to a tag and all the files that have that tag assigned will appear to the right of the table (vo-right, after un-interacting with the Sidebar if you interacted).

Removing Tags

If you want to remove a tag from a file, find the file and open its Tag Editor as described above. The text field where you can type new tags will already hold all the tags assigned to the selected file; navigate around and delete these as you would any other text. Note that they appear as what Voiceover calls "attached text", so no matter how many words are in a tag's name, Voiceover will read the entire tag as you arrow over it, it will not read character by character. Despite this, you can move around like normal by simply imagining that every tag is itself a character. Move past one, then hit delete, to remove it from the field, for instance.

To delete a tag entirely, show the Finder's sidebar if it is not already, as described above. Find the "Tags" item and expand it to reveal all the tags on your Mac. Navigate to the tag you wish to erase, bring up its context menu with vo-shift-m, and choose to delete it. As you will see, you can also open the tag in a new tab (showing all files marked with it), rename the tag, remove it from the current file (if it is assigned to that file), and assign it a color. Note that deleting the tag will remove it from the system, thereby un-assigning it from all your files, but will not touch any files themselves.

Final Thoughts

I hope you found this useful. Leave comments so i know what was not clear and can update this guide. You may also find me on Twitter: @VOTips. Happy tagging!

Disclaimer

The article on this page has generously been submitted by a member of the AppleVis community. As AppleVis is a community-powered website, we make no guarantee, either express or implied, of the accuracy or completeness of the information.

Options