MetaDataQuery.SetSearchScopes
-----------------------------

Sets the search scopes.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MetaDataQuery](component_MetaDataQuery.md) | [8.0](newinversion80.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "MetaDataQuery.SetSearchScopes"; Query; SearchScopes ) 

**MBS**( **"MetaDataQuery.SetSearchScopes";** /\* Sets the search scopes. \*/  
**$Query**; /\* The reference number of the query. \*/   
**$SearchScopes**) /\* The list of search scopes.e.g. "LocalComputerScope" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Query | The reference number of the query. | $query |
| SearchScopes | The list of search scopes. | "LocalComputerScope" |

### Result

Returns OK or error.

### Description

Sets the search scopes.  
Please pass a list with file paths and special keywords used to specify specific locations:  
  
| Key | Description |
|---|---|
| UserHomeScope | Search the user’s home directory. |
| LocalComputerScope | Search all local mounted volumes, including the user home directory. The user’s home directory is searched even if it is a remote volume. |
| NetworkScope | Search all user-mounted remote volumes. |
| UbiquitousDocumentsScope | Search all files in the Documents directories of the app’s iCloud container directories. |
| UbiquitousDataScope | Search all files not in the Documents directories of the app’s iCloud container directories. |
| AccessibleUbiquitousExternalDocumentsScope | Search for documents outside the app’s container. This search can locate iCloud documents that the user previously opened using a document picker view controller. This lets your app access the documents again without requiring direct user interaction. |
| IndexedLocalComputerScope | Search all indexed local mounted volumes including the current user’s home directory (even if the home directory is remote). |
| IndexedNetworkScope | Search all indexed user-mounted remote volumes. |

### Examples

Search home folder:

 MBS ( "MetaDataQuery.SetSearchScopes"; $Query ; "UserHomeScope" )  
Search application folder:

 MBS ( "MetaDataQuery.SetSearchScopes"; $Query ; "/Applications" )  
### See also

- [MetaDataQuery.SearchScopes](MetaDataQuerySearchScopes.md)

This function checks for a license.

Created 16th December 2017 , last changed 16th December 2017

  
[MetaDataQuery.SetScript](MetaDataQuerySetScript.md) - [MetaDataQuery.StartQuery](MetaDataQueryStartQuery.md)

[HTML Version](MetaDataQuerySetSearchScopes.shtml)