Sort tags and groups by color

As of DEVONthink v3.9.6, it’s possible to customize the icon color of tags and groups, but the option to sort by color in the viewer window does not yet exist.

Below are some of the things one can do with a sort-by-color ability:

1. More efficient management of tags. I use a large number of tags in my main reference database. These tags are divided into several categories, each represented by a specific color. (For example, all geolocation tags are in light green, all tech-related tags in purple, etc.) Sorting by color in the tags group would be an efficient way to “group together” all tags in one such category.

2. Always position a group at top. A group of importance, when assigned a specific color, would stay on top of the item list when viewing any group containing it. It would no longer be necessary to change Group Name to 1. Group Name, or use Unsorted and arrange things manually.

There is more than one possible way to sort RGB colors. I’d say (R+G+B) → R → G, but I wouldn’t complain at all if another way of sorting colors is actually implemented.

P.S. There is no “change color” GUI for normal groups. The AppleScript dictionary claims that color is only supported by tags. Nevertheless, you can easily change the color of groups via scripting. For example:

  • set (color of theGroup) to {65535, 65535, 65535} for a white group icon.
  • set (color of theGroup) to missing value to return to default.
1 Like

I guess someone must update the dictionary.

Just as an aside: With JXA, one must specify colors as a list of values in the range [0…65535], although color() returns an array in the range [0…1]. That is weird. Similarly weird is that color() for the default returns undefined, whereas setting color to undefined to get the default results in an error. One must use null to restore the default.

I’d think that a more symmetric behavior, where the values returned by color() are those one would use to set the property are the same.