I’d like to add tags to files/folders. Mac OS supports several tags for a given folderitem, each having a separate colour.
When I do this:
Var Tags() As String=Array(“Custom tag 1”,“Custom tag 2”)
Var Result As Integer=Item.SetTagNamesMBS(Tags)
This adds the tags; fine. But how do I tell that “Custom tag 1” would be, for instance, green and “Custom tag 2” would be orange?
(those tags may not already be known by the OS).
Well, you don’t define the color since the API for this only takes text.
Maybe the user can define such a tag before and it picks up the color for other files?
In at least two apps, I can add a tag with a specific colour (the Finder and Path Finder).
Using the Finder, I choose “Tags…” and start to type a value that doesn’t yet exist, in the text field. There’s the option to create the tag with that name and to choose the colour.
In Path Finder, under “Tags and ratings”, I can add tags and change the colour of the existing tags.
Perhaps I’m looking at the wrong place?
This would probably work; I’m still hoping to get how other apps can define the colours for each tag.
Maybe it’s not using the tags API for folderitems?
Related (so not really off topic):
I fired AppleScript Editor,
Set recording mode
back to Finder
Create new folder,
Set tag to red
Back to AppleScript Editor
Stop recording
The red Tag does not appeared in the code.
Checked the AppleScript dictionaries for Finder and Standard Addition: tag is unknown…
Thanks for your answers.
It looks like the Chr(10) trick does what I want, up to a certain point.
Hoping that won’t break soon (as it’s a backward compatibility feature).