Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This does not cover tags, but for changing label colors, one way to do it is through a command like this:</p> <pre><code>xattr -wx com.apple.FinderInfo \ 0000000000000000000400000000000000000000000000000000000000000000 myfile.txt </code></pre> <p>The <code>04</code> buried in the middle is setting the file color.</p> <p>Here is a python script which wraps that command lets you set the tag color on a file or series of files:</p> <pre><code>import sys import subprocess def colorizeFile(ColorName,FileName): ReverseTable = { "clear" : "01", "gray" : "03", "green" : "04", "purple" : "06", "blue" : "09", "yellow" : "0A", "red" : "0C", "orange" : "0E", "c" : "01", "a" : "03", "g" : "04", "p" : "06", "b" : "09", "y" : "0A", "r" : "0C", "o" : "0E", } HexString = 18*"0" + ReverseTable.get(ColorName) + 44*"0" Xcommand = 'xattr -wx com.apple.FinderInfo {0} {1}'.format(HexString,FileName) ProcString = subprocess.check_call(Xcommand, stderr=subprocess.STDOUT,shell=True) if __name__ == "__main__": if len(sys.argv)&lt;3: sys.stderr.write(__doc__.format(sys.argv[0])) else: Cname = sys.argv[1] Flist = sys.argv[2:] for File in Flist: colorizeFile(Cname.lower(),File) sys.stderr.write("## Colorized {0} file(s) as {1}\n".format(len(Flist),Cname)) </code></pre> <p>Usage is:</p> <pre><code> labelcolor.py [color] *.jpg </code></pre> <p>where [color] is a name or abbreviation as defined below:</p> <pre><code> clear (c), grAy (a), green (g), purple (p), blue (b), yellow (y), red (r), orange (o) </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. This table or related slice is empty.
    1. 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