FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » Search, sort using custom file attributes
Re: Search, sort using custom file attributes [message #1822 is a reply to message #1812] Tue, 16 July 2024 16:09 Go to previous message
FoxTrot Engineering
Messages: 406
Registered: April 2020
Senior Member
Yes, you can search custom extended attributes.
These attributes start with the "com.apple.metadata:" prefix. For example, to add a publication year attribute, type the following command in a Terminal.app window (replace ... by the path to your file):
xattr -w com.apple.metadata:publication.year "1970" ...
The content of these attributes are added to the "other metadata" field when updating the index, so you can find it by searching either [content, any metadata or file name], or just [other metadata].
To specifically search a given custom attribute, add a [then filter by Spotlight attribute] criterion, select [other Spotlight attribute…] in the popup menu, click the [Add…] button, and type the extended attribute name (without the "com.apple.metadata:" prefix), as well as a human readable name and description, and click [Add]. Make sure to check the [in menu] checkbox for this attribute, and click [OK]. Then select this attribute in the [then filter by Spotlight attribute] criterion popup menu.
You can't sort the result list by a custom attribute; however when using [then filter by Spotlight attribute], the content of this (Spotlight or extended) attribute should appear in the excerpt column.


Jérôme - FoxTrot Engineering
 
Read Message
Read Message
Previous Topic: Icons for folders are suddenly replaced with network drive icons??
Next Topic: [HELP] Unable to search for "saturate", "saturation", "saturating", "saturated" with single search?
Goto Forum:
  


Current Time: Tue Dec 03 18:35:46 GMT+1 2024