Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Sets the predicate to search.

Component Version macOS Windows Linux Server iOS SDK
MetaDataQuery 8.0 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "MetaDataQuery.SetQueryString"; Query; QueryString )   More


Parameter Description Example
Query The reference number of the query. $query
QueryString The query string. "kMDItemContentType=\"\""


Returns OK or error.


Sets the predicate to search.
The plugin will build the predicate with the given query string.
Setting this property while a query is running stops the query and discards the current results. The receiver immediately starts a new query.

See list of metadata keys here:

Expression syntax:


Search for applications

MBS( "MetaDataQuery.SetQueryString"; $Query; "kMDItemContentType=\"\"")

Start a query:

Set Variable [ $query ; Value: MBS( "MetaDataQuery.Create" ) ]
Set Variable [ $r ; Value: MBS( "MetaDataQuery.SetQueryString"; $Query; "kMDItemContentType=\"\"") ]
Set Variable [ $r ; Value: MBS( "MetaDataQuery.StartQuery"; $Query) ]

Search with wildcard with LIKE:

MBS( "MetaDataQuery.SetQueryString"; $Query; "kMDItemFSName like[c] '*3625.jpg' ")

See also

Example Databases

Blog Entries

This function checks for a license.

Created 16th December 2017, last changed 8th September 2021

MetaDataQuery.SetEvaluate - MetaDataQuery.SetScript