MetaDataQuery.PathAtIndex
-------------------------

Queries path of an item in results.

| 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.PathAtIndex"; Query; Index ) 

**MBS**( **"MetaDataQuery.PathAtIndex";** /\* Queries path of an item in results. \*/  
**$Query**; /\* The reference number of the query. \*/   
**$Index**) /\* The index of the item.  
Range from 0 to [MetaDataQuery.ResultCount](MetaDataQueryResultCount.md)-1.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Query | The reference number of the query. | $query |
| Index | The index of the item.   Range from 0 to [MetaDataQuery.ResultCount](MetaDataQueryResultCount.md)-1. | 0 |

### Result

Returns text or error.

### Description

Queries path of an item in results.  
### Examples

Put paths in records:

 Set Variable \[ $index ; Value: 0 \]   
Loop  
 New Record/Request  
 Set Variable \[ $path ; Value: MBS ( "MetaDataQuery.PathAtIndex"; $Query ; $Index ) \]   
 Set Field \[ Search Applications::FilePath ; $path \]   
 Commit Records/Requests \[ With dialog: Off \]   
 # next  
 Set Variable \[ $index ; Value: $index + 1 \]   
 Exit Loop If \[ $index ≥ $count \]   
End Loop  
### See also

- [MetaDataQuery.ResultAtIndex](MetaDataQueryResultAtIndex.md)
- [MetaDataQuery.ResultCount](MetaDataQueryResultCount.md)

### Example Databases

- [Mac only/MetaDataQuery/Find FileMaker Databases](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/MetaDataQuery/Find%20FileMaker%20Databases.shtml#1ScriptAnchor_)
- [Mac only/MetaDataQuery/Search Applications](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/MetaDataQuery/Search%20Applications.shtml#1ScriptAnchor_)

### Blog Entries

- [Spotlight search in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2017-12-16/Spotlight_search_in_FileMaker_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 16th December 2017 , last changed 9th November 2021

  
[MetaDataQuery.List](MetaDataQueryList.md) - [MetaDataQuery.Paths](MetaDataQueryPaths.md)

[HTML Version](MetaDataQueryPathAtIndex.shtml)