Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sorry for adding another answer, but the one related to setting Label colors was pretty long already. Here is an excerpt from a python script that I use to set the User Tags. It seems to work to make things searchable, but not sure if the tags will show up correctly. Usage is basically:</p> <pre><code>tagfile.py "Tag Name" FileOrFolderName </code></pre> <p>Code below. </p> <pre><code>#! /usr/bin/env python # -*- coding: utf-8 -*- """ Write tags to file Usage: tagfile.py "TagName" FileName1 FileName2 You can use wildcards for the file name. Use quotes if spaces in tags. To check if it worked, use xattr -l FileName """ import sys import subprocess def writexattrs(F,TagList): """ writexattrs(F,TagList): writes the list of tags to three xattr fields on a file-by file basis: "kMDItemFinderComment","_kMDItemUserTags","kMDItemOMUserTags Uses subprocess instead of xattr module. Slower but no dependencies""" Result = "" plistFront = '&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;&lt;plist version="1.0"&gt;&lt;array&gt;' plistEnd = '&lt;/array&gt;&lt;/plist&gt;' plistTagString = '' for Tag in TagList: plistTagString = plistTagString + '&lt;string&gt;{}&lt;/string&gt;'.format(Tag.replace("'","-")) TagText = plistFront + plistTagString + plistEnd OptionalTag = "com.apple.metadata:" XattrList = ["kMDItemFinderComment","_kMDItemUserTags","kMDItemOMUserTags"] for Field in XattrList: XattrCommand = 'xattr -w {0} \'{1}\' "{2}"'.format(OptionalTag + Field,TagText.encode("utf8"),F) if DEBUG: sys.stderr.write("XATTR: {}\n".format(XattrCommand)) ProcString = subprocess.check_output(XattrCommand, stderr=subprocess.STDOUT,shell=True) Result += ProcString return Result DEBUG = False if __name__ == "__main__": if len(sys.argv) &lt; 3: print __doc__ else: TagList = [ sys.argv[1] ] # print TagList # Or you can hardwire your tags here # TagList = ['Orange','Green'] FileList = sys.argv[2:] for FileName in FileList: writexattrs(FileName, TagList) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload