I'm tagging USB and network drives in Mavericks, and I would like the tags to disappear from my Mac when the drives are disconnected. Is this possible?
MacOS – How to hide file tags
finder-tagmacosprivacy
Related Solutions
In a nutshell, how would one access this feature in Finder – not Spotlight (Command+Space) – but the adding of tags themselves?
From Finder, highlight a file and hit Cmd-I (or right click and select Get Info) to bring up the File Info Dialog for the file. In this dialog, the Spotlight Comments field is where you add tag data. Just add text to this field to "tag" the file.
Here's a good article on how to become a meta-data wizard in OS X:
https://gigaom.com/2007/02/01/using-metadata-effectively-in-os-x/
If was tagging that screen capture, I might use the following in the comments box:
customer-name presentation product-name
So that I could find that screen shot by the customer, or by the fact that it's being used in a presentation, or by the name of the product I'm showing them.
Where are these tags stored? Do they go in .DS_Store (I tend to delete those!) or elsewhere in the filesystem?
Yes, they're stored in the .DS_Store
files you see in each folder. These files are read by Finder. The information is also stored in Extended Attributes (EAs) on the files themselves. Spotlight will prefer to read the data from EAs. EAs are a feature of the HFS+ filesystem, so remote filesystems might not necessarily have EAs available on files. In these cases, .DS_Store
files are the fallback. Spotlight would also have a tag <-> file mapping section in its database but that's only accessible to Spotlight.
Does this tagging mechanism work on removable drives? What are the requirements?
Generally: yes. You can add tags to files and folders on removable drives and remote shares. Unless you've turned off .DS_Store
creation on remote shares, OS X will just add these files and keep the meta-data there for you.
Does this tagging mechanism work over a network share? I have some Windows SMB network shares at home that I frequently store files on. Would it work on those or is another configuration required?
Yes, see above. If you didn't want OS X to do this, run:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
And then restart Finder.
Aside from Spotlight, are there any command-line tools for searching through or accessing the tag data for files?
Lots!
Here's a list of 7 file-tagging applications for OS X: http://mac.appstorm.net/roundups/utilities-roundups/7-file-tagging-applications-for-os-x/
I personally love and use LaunchBar which is like Spotlight on steroids.
This problem has been bugging me for months. I've kept a weather eye on the Google results, poked around trying to find my own solution, upgraded to Yosemite to see if the issue was resolved there, but nothing turned up. So, during the Thanksgiving break I decided to sit down and fix this once and for all.
Looooong story short, every time you add a new tag (and possibly when you add a tag to a file) it gets popped into the Finder sidebar for easy access. Handy. Thing is, if you get crazy and add a metric ton of tags, none of them are ever removed from the Finder sidebar. They roll off the edge where you can't see them, and are flagged as "visible if newer items are removed" but they are all retained in the sidebar items plist. This plist gets massive, and takes a long time to parse any time it must be modified.
To make things worse, when you have "documents and data" turned on under System Preferences > iCloud the tag list is synced. This means the hang follows you to every machine where you are signed into iCloud, even on a fresh reload of OS X. Funfunfun.
Thankfully, there is an easy fix. I'll keep the explanation simple for Joe Internet who may be having this problem stumble across this post.
When the Finder is running properly (not beach-balled), right-click on the icon in the Dock and select "Go to Folder". In the dialog that appears type "~/Library/Preferences/". That funny little squiggle at the front is just a nice little shortcut that tells the dialog to start in your home folder for the path, rather than the root of the internal drive.
You will be presented with a cornucopia of scary looking plists. The one we are after is titled "com.apple.sidebarlists.plist". Copy that plist somewhere you can find it later (just in case something goes awry and you have to put it back.) Now, delete the the original plist in the Library folder and reboot your machine. After the reboot Finder will have an empty tag sidebar and you can create, delete, and rearrange tags to your hearts content. No hangs. As long as you have iCloud "Documents and Data" enabled, this new clean sidebar will also be uploaded to iCloud and clear out the old gigantic one on all your machines.
It should be noted that this DOES NOT delete the tags from your files. That information is actually appended to an extended attribute (xattr) of the file itself, rather than being stored in a single plist or database somewhere. Thankfully the tags on the files themselves aren't what's causing the hang issue, so we can leave them untouched.
Of course, what you will lose are the list of tags and custom folders you want in the Finder sidebar. Add the folders back the normal way (drag them into the sidebar) and you can select which tags you want by going to the Finder menu > Preferences > Tags and checking the boxes. I've got about a dozen and things are snappy.
One other unfortunate loss are the tags' assigned colors. That's strictly stored in the Finder's plist. The tags may appear to retain their color until you add them back to the sidebar, or try to apply a tag to an item, at which point the color vanishes.
After you've added a tag or two back to the sidebar the "all tags" item will reappear at the bottom of the list. Click on that and scroll through the list of tags to re-assign their colors. Make sure to re-apply color even to the tags that appear to have retained it, because when that tag is next added to a file or otherwise modified there's a good chance the color will disappear.
Something to note if you have a lot of colors applied: adding them all back may cause the hang issue to re-manifest. All those color assignments are stored in the plist, and too many may drag things down. I've only got a few color assignments so I haven't been able to verify this theory.
That's it! Congratulations! Tags are now usable on your machine(s) again. Just remember to go into Finder > Preferences > Tags every now and again and clear the checkbox or minus sign from the tags you don't want displayed in the sidebar and things should remain snappy.
Related Question
- MacOS – Using Maverick’s tags on Mountain Lion
- MacOS – Are tags portable, and if so how
- MacOS – How to tag files (with Finder tags) using parts of a file name
- MacOS – Tools to support maintenance jobs with Finder tags
- Are finder tags case-sensitive
- MacOS – Using Tag how to cut and parse file paths into tags
Best Answer
I'm curious if there's a more permanent solution, such as a way to create tags so that they're transient in the first place.