Sub topic 2
Applying and removing tags
Tags are labels you attach to files and folders without moving them. This chapter covers the ways to apply a tag, the ways to remove one, and how to check the result. It assumes you can navigate Finder windows and folders and use menus and keyboard shortcuts. It also assumes you have read the previous chapter on why tags, smart folders, and the sidebar work together.
What a tag does to a file
A tag is stored as metadata on the item. The file's contents and location do not change. One item can carry several tags, and many items can share one tag. Because a tag is not a folder, a file can belong to several groups at once.
A tag has a name and, optionally, a color. A tag with no color shows as a gray dot. Colors are covered in the next chapter.
Applying tags
Finder gives you several routes to the same result. Pick the one that fits what you are doing.
| Method | Steps | Best for |
|---|---|---|
| Context menu | Control-click the item, then choose a color dot or Tags… | One-off tagging |
| File menu | Select items, choose File, then pick a color or Tags… | Many selected items |
| Toolbar | Click the Tags button, then choose or type a tag | Quick tagging with a search field |
| Preview pane | Select an item, press Shift-Command-P, then click Add Tags | Seeing existing tags next to the file |
| Drag to sidebar | Drag items onto a tag listed in the sidebar | Tagging many items with an existing tag |
| Save dialog | Type in the Tags field when saving a document | Tagging at creation time |
If the Tags button is missing from the toolbar, choose View, then Customize Toolbar, and drag it in.
Typing a tag name
In the Tags field, start typing. Finder suggests matching tags. Press Return to accept a suggestion. If you type a name that does not exist, Finder creates a new tag with that name. Separate several tags with a comma or press Return after each one.
Be careful with spelling. Typing Invoce creates a second tag next to Invoice, and a search for one will not return files with the other.
Removing tags
Removing a tag only deletes the label. The file stays where it is.
- Select the item and open the Tags field in the Preview pane, the toolbar Tags button, or the context menu Tags… entry.
- Click the tag you want to remove.
- Press Delete.
A colored dot in the context menu works as a toggle. If every selected item already has that color tag, clicking the dot removes it. To clear all tags from the selection at once, choose Tags… and delete each entry, or use the context menu's color row.
Checking what you applied
In Finder, list view with the Tags column shows each item's tags. To see the stored value from Terminal, use the Spotlight metadata tool:
mdls -name kMDItemUserTags ~/Documents/report.pdfThe output is a list of the tag names on the file, or (null) if it has none. The metadata is the same data that Finder uses when you search by tag.
Exercise
You select five invoices and type "Invoce" in the toolbar Tags field by mistake, and press Return. What happens, and how do you fix it?
Show answer
Finder creates a new tag named "Invoce" and applies it to all five files, because it creates any name that does not already exist. To fix it, remove the "Invoce" tag from the five items (select them, open the Tags field, click the tag, and press Delete). Then apply the correctly spelled "Invoice" tag. You can then delete the stray "Invoce" tag from the tag list so it does not appear in suggestions.