File path with SavedSearch?

I find endless uses for the Finder's SavedSearch function. But some of the 'criteria' could use some explaining. Has anyone seen a full explication of all search attributes?


I used the built-in Help, of course, but it's quite short of specifics. The term 'Location', for instance, could use a longer description; so too 'Raw Query', and 'Recipients' (does this mean email? or a remote volume after a file is dragged to a folder?).


The power of this feature is undeniable. No doubt Apple has more detailed explanation, but where?


MacBook Pro 13", macOS 10.14

Posted on May 21, 2020 1:48 PM

Reply
Question marked as Top-ranking reply

Posted on May 21, 2020 4:41 PM

Here are the definitions of the metadata. But, I don't know if it is any better than the help file you mentioned as I haven't seen that.

You have to figure out which kMDItem attribute matches the names in the search criteria. It doesn't really say what data is stored (or how it is represented). You have to make inferences from the other attributes, or look at examples in the file system with the MetaData List (mdls) command in Terminal.

For instance, there are three Recipients metadata items, Recipients, Recipient Email Addresses, and RecipientsAddresses. So, Recipients would likely be the names of people who received the item, Addresses would be physical address or possibly URL, and Email Addresses would be the email addresses. When searching for a file that had that metadata set, I found a new one named kMDItemDestinationRecipients which contained an array of email addresses (well, it was just my single email address, in an array).


A Raw Query is using the actual metadata attribute names (listed in the above linked document) to form a query. You can use logical operators to combine individual attributes into a complex query.

It is quite handy when you need to list items that where a particular metadata item exists or doesn't exist.

For instance, the Recents folder depends on a file having the kMDItemLastUsedDate set to something. That attributed is actually an array of dates when the file was used. But. all Recents cares about is if it has at least one date. Part of the Raw Query uses,

(kMDItemLastUsedDate = "*"). 

That basically says give me any file where the kMDItemLastUsedDate has any value at all. In the GUI, you could use a "None of the following" group to list files where none have a Last Used Date using the same raw query string.


You can use shortcuts to these search attributes in the Finder, like

kind: Document name: turtle

to find Documents that have "turtle" in the name.


Raw Query is quite powerful if you need to generate more complex searches than the GUI can accommodate. I have found quite a few articles about Raw Queries over the years. There is likely much better info on the web that Apple provides (always been notoriously bad in this respect).


Finally, File Path (in the title) is not searchable. The only way to search a specific folder is to start the search in that folder. File Path cannot be used in a GUI query or in a Raw Query. For whatever reason, it isn't searchable metadata.

1 reply
Question marked as Top-ranking reply

May 21, 2020 4:41 PM in response to Michael Spencer

Here are the definitions of the metadata. But, I don't know if it is any better than the help file you mentioned as I haven't seen that.

You have to figure out which kMDItem attribute matches the names in the search criteria. It doesn't really say what data is stored (or how it is represented). You have to make inferences from the other attributes, or look at examples in the file system with the MetaData List (mdls) command in Terminal.

For instance, there are three Recipients metadata items, Recipients, Recipient Email Addresses, and RecipientsAddresses. So, Recipients would likely be the names of people who received the item, Addresses would be physical address or possibly URL, and Email Addresses would be the email addresses. When searching for a file that had that metadata set, I found a new one named kMDItemDestinationRecipients which contained an array of email addresses (well, it was just my single email address, in an array).


A Raw Query is using the actual metadata attribute names (listed in the above linked document) to form a query. You can use logical operators to combine individual attributes into a complex query.

It is quite handy when you need to list items that where a particular metadata item exists or doesn't exist.

For instance, the Recents folder depends on a file having the kMDItemLastUsedDate set to something. That attributed is actually an array of dates when the file was used. But. all Recents cares about is if it has at least one date. Part of the Raw Query uses,

(kMDItemLastUsedDate = "*"). 

That basically says give me any file where the kMDItemLastUsedDate has any value at all. In the GUI, you could use a "None of the following" group to list files where none have a Last Used Date using the same raw query string.


You can use shortcuts to these search attributes in the Finder, like

kind: Document name: turtle

to find Documents that have "turtle" in the name.


Raw Query is quite powerful if you need to generate more complex searches than the GUI can accommodate. I have found quite a few articles about Raw Queries over the years. There is likely much better info on the web that Apple provides (always been notoriously bad in this respect).


Finally, File Path (in the title) is not searchable. The only way to search a specific folder is to start the search in that folder. File Path cannot be used in a GUI query or in a Raw Query. For whatever reason, it isn't searchable metadata.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

File path with SavedSearch?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.