Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to extract tags colours of iCloud items #355

Open
mikekazakov opened this issue Aug 14, 2024 Discussed in #354 · 3 comments
Open

Unable to extract tags colours of iCloud items #355

mikekazakov opened this issue Aug 14, 2024 Discussed in #354 · 3 comments

Comments

@mikekazakov
Copy link
Owner

Discussed in #354

Originally posted by ww7 August 12, 2024
Tagged files/folders that in sync with iCloud is greyed, NC can't detect the color and operate them.

Another thing, context menu shows only default tags, so any interface to manage them would be good. I'm added script that call Get Info from Finder for now.

@mikekazakov
Copy link
Owner Author

mikekazakov commented Aug 14, 2024

Example xattr of an item that has a yellow tag:

$ xxd -i ./com.apple.metadata\:_kMDItemUserTags 
unsigned char __com_apple_metadata__kMDItemUserTags[] = {
  0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30, 0xa1, 0x01, 0x58, 0x59,
  0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x0a, 0x31, 0x08, 0x0a, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x13
};
unsigned int __com_apple_metadata__kMDItemUserTags_len = 53;

$ xxd ./com.apple.metadata\:_kMDItemUserTags
00000000: 6270 6c69 7374 3030 a101 5859 656c 6c6f  bplist00..XYello
00000010: 770a 3108 0a00 0000 0000 0001 0100 0000  w.1.............
00000020: 0000 0000 0200 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 13                             .....

NC shows it as grey.

@mikekazakov
Copy link
Owner Author

I've looked into the issue and it turns out Apple breaks its own encoding when writing the "com.apple.metadata:_kMDItemUserTags" extended attribute for iCloud documents. The tags there are always marked as Gray, regardless of an actual colour. Don't know where they store the colour information in this case, any hints are welcome.

@mikekazakov
Copy link
Owner Author

Investigated a bit more. Interestingly enough, Finder does set the correct color information in the xattr, but then it gets immediately overridden into the grey color:

[2024-09-22 17:58:33.515] [vfs] [debug] [Host.mm:236] Extracted the tags of the file 'Downloads': Orange (7)
...
[2024-09-22 17:58:33.772] [vfs] [debug] [Host.mm:236] Extracted the tags of the file 'Downloads': Orange (1)

mikekazakov added a commit that referenced this issue Sep 22, 2024
mikekazakov added a commit that referenced this issue Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant