I can write to the -mditemfslabel
tag to change the finder color label of files in Mac OS but how can I do that to a directory? (ignoring the files contained therein.) Is that possible?
Thanks,
Phil
Hi Phil,
Sorry, ExifTool operates only on files, not directories.
- Phil
AppleScript can do it with ease but is probably OT. PM me if you want to follow up.
Yes. In fact, this is what ExifTool does when writing this:
osascript -e 'set fp to POSIX file "$f" as alias' -e \\
'tell application "Finder" to set comment of file fp to "$v"'
I suppose this may work for directories.
- Phil
Quote from: Phil Harvey on October 30, 2020, 09:36:37 PM
I suppose this may work for directories.
It does.
The Finder colour label is referred to by the "label index" of the item (file or folder) and comes from an apparently arbitrary list:
No colour = 0
Orange = 1
Red = 2
Yellow = 3
Blue = 4
Purple = 5
Green = 6
Grey = 7
In straight AppleScript...
set the_folder to (choose folder)
tell application "Finder" to set label index of the_folder to 4
Will give the chosen folder a blue label, although the Finder display may not update immediately.