Run the query, and populate the query with the results.
- macOS 10.4+
- Core Services
The query to execute.
A bitwise OR of the
MDQueryto be used by the query.
TRUE if the query was started,
FALSE otherwise. Queries cannot be executed more than once.
Queries only gather results or process updates while the current thread's run loop is running.
Queries have two phases: the initial gathering phase that collects all currently matching results and a second live-update phase. Updates occur during the live-update phase if a change in a file occurs such that it no longer matches the query or if it begins to match the query. Files which begin to match the query are added to the result list, and files which no longer match the query expression are removed from the result list.
Query notifications are posted within the context of the same thread which executes the query.