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

Add support for additional com.apple.metadata attributes #18

Closed
6 tasks done
RhetTbull opened this issue Apr 7, 2020 · 0 comments
Closed
6 tasks done

Add support for additional com.apple.metadata attributes #18

RhetTbull opened this issue Apr 7, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@RhetTbull
Copy link
Owner

RhetTbull commented Apr 7, 2020

  • • com.apple.metadata:kMDItemDueDate

Date this item is due. A CFDate.
https://developer.apple.com/documentation/coreservices/kmditemduedate?language=objc

Also mentioned here:
https://discussions.apple.com/thread/5147890

in addition to being exposed by Finder Smart Folders, it’s also exposed via Noodlesoft’s Hazel (I believe both Finder Smart Folders and Hazel expose most of the xattrs listed below as well).

  • • com.apple.metadata:kMDItemParticipants

The list of people who are visible in an image or movie or written about in a document. A CFArray of CFStrings.
https://developer.apple.com/documentation/coreservices/kmditemparticipants?language=objc

  • • com.apple.metadata:kMDItemVersion

The version number of this file. A CFString.
https://developer.apple.com/documentation/coreservices/kmditemversion?language=objc

  • • com.apple.metadata:kMDItemProjects

The list of projects that this file is part of. For example, if you were working on a movie all of the files could be marked as belonging to the project “My Movie”. A CFArray of CFStrings.
https://developer.apple.com/documentation/coreservices/kmditemprojects?language=objc

  • • com.apple.metadata:kMDItemFSIsStationery

Boolean indicating if this file is stationery. Type is a CFBoolean.
https://developer.apple.com/documentation/coreservices/kmditemfsisstationery?language=objc

Would perhaps be nice to programmatically control a file being stationery or not, but I have no idea if this xattr is even used by Finder. Checkmarking the 'Stationery pad' option in a Finder 'Get Info' window just associates a 'com.apple.FinderInfo' xattr with the file instead (stripping that FinderInfo xattr does uncheck the 'Stationery pad' option when doing a 'Get Info' on the file). I did try making a bplist with the following content:
62 70 6C 69 73 74 30 30 09 08 00 00 00 00 00 00
01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 09

as human-readable text:

but Finder’s 'Get Info' doesn’t pick up the change (Stationery pad is still unchecked), so this xattr is probably useless in practice (unless I messed up somewhere).

  • • com.apple.metadata:kMDItemStarRating

User rating of this item. For example, the stars rating of an iTunes track. A CFNumber.
https://developer.apple.com/documentation/coreservices/kmditemstarrating?language=objc

Like 'kMDItemFSIsStationery', could be convenient to be able to easily programmatically control this for files, but iTunes 12.8.2.3 doesn’t seem to set this xattr on any of my music tracks that I’ve given ratings to in iTunes, and I’ve tested that iTunes will ignore a 'kMDItemStarRating' xattr on a file. I suppose this could be still be somewhat useful since Finder v10.11.4 actually does let you add a sortable 'Rating' column (but only in the 'Music' directory located in your home directory!), and surprisingly, associating a kMDItemStarRating xattr with a music file in the 'Music' directory actually reflects the integer in the Rating field! Unfortunately, it’s still an xattr of limited use (only good for sorting by Rating in Finder), but might be more useful if a music player existed that read from and used this xattr for star ratings.

@RhetTbull RhetTbull added the enhancement New feature or request label Apr 7, 2020
RhetTbull added a commit that referenced this issue Jul 8, 2021
RhetTbull added a commit that referenced this issue Jul 8, 2021
RhetTbull added a commit that referenced this issue Jul 9, 2021
RhetTbull added a commit that referenced this issue Jul 9, 2021
RhetTbull added a commit that referenced this issue Jul 9, 2021
RhetTbull added a commit that referenced this issue Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant