Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all filesystem tags

Since OSX Mavericks supports file tags. Is there any API to access these programmatically? How can I get a list of all system tags? And manipulate them?

I tried already:

  • NSFileManager class
  • File System Programming Guide
  • File Metadata Search Programming Guide

yet none of those mention the existance of tags.

like image 409
SystematicFrank Avatar asked Oct 02 '22 10:10

SystematicFrank


2 Answers

You can find all system tags in this path: ~/Library/SyncedPreferences/com.apple.finder.plist

But the default the plist file doesn't exist. You can make it appear by adding a new tag. By the way, do you find other way to get all system tags?

like image 143
sam Avatar answered Oct 07 '22 04:10

sam


Don't know whether this is what you are looking for:

see this thread for adding tags programmatically How can I add OS X "tags" to files programmatically?

also if you look at the NSURL reources page http://goo.gl/fwHMWk it says about getting names of tags attached to the resource, returned as an array of NSString values using the NSURLTagNamesKey.

like image 29
Vivek Avatar answered Oct 07 '22 02:10

Vivek