Convert Color label to color tag in Finder

Started by bryce, June 10, 2020, 10:36:13 PM

Previous topic - Next topic

bryce

I've been looking at a hand full of similar examples, but I'm not quite understanding or finding the right answer for what I'm trying to do.

similar example:

this will pull the color label from finder and put it into a keyword.
exiftool -r -use MWG -overwrite_original_in_place -addTagsFromFile @ '-Keywords+<mditemusertags' 'mac-os-platform/specific/path/to/file/or folder/here.tif'

but I want to pull the label tag (Red, Orange, Green,...) and put it into a Finder color tag for all images inside a folder

Phil Harvey

The form of the command is the same, but you need to have the 'tag' utility to write MDItemUserTags.  See the notes for the MDItemUserTags in the MacOS MDItem tag documentation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Stephen Marsh

What is the difference between the label tag and the "color" tag? How do you apply the "color" tag using the Finder?

If you use the following Terminal command on a file with this "color" label, what data is returned?

xattr -l FILE

_kMDItemUserTags is the "label tag"... But what is the "color" tag?

Phil Harvey

#3
Hi Stephen,

Try setting a color for a file in the finder, and looking at the MDItem attributes with ExifTool.

- Phil

Edit: Sorry.  I thought you were asking me these questions, but I think you were asking Bryce.  My response should have been directed to Bryce.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bryce

Thanks Phil, this is what I have:

exiftool -r -overwrite_original_in_place '-label' @ '-MDItemFSLabel'

I'm just not sure how to translate say a Green label to MDItemFSLabel number for green (2), and then red to 6, and Purple to 3, etc:
0 = 0 (none)
1 = 1 (Gray)
2 = 2 (Green)
3 = 3 (Purple)        
4 = 4 (Blue)
5 = 5 (Yellow)
6 = 6 (Red)
7 = 7 (Orange)


When I run what I have I get:
exiftool -r -overwrite_original_in_place '-label' @ '-MDItemFSLabel' /Users/bryce/Desktop/Test/pact_VIBE-ON-FPO.jpg
Error: File not found - @
======== /Users/bryce/Desktop/Test/pact_VIBE-ON-FPO.jpg
Label                           : Green
MD Item FS Label                : 0 (none)
    1 image files read
    1 files could not be read
brycedgtl@BRYCEDGTL-MBP04-2 ~ %


Phil Harvey

Hi Bryce,

Try this:

exiftool "-mditemfslabel<label" FILE

(too simple, I know)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).