Printer.PrinterName
-------------------

Queries the name of the printer with given index.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Printer](component_Printer.md) | [3.0](newinversion30.md) | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |

MBS( "Printer.PrinterName"; Index ) 

**MBS**( **"Printer.PrinterName";** /\* Queries the name of the printer with given index. \*/  
**$Index**) /\* The index of the printer.   
From 0 to PrinterCount-1.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Index | The index of the printer.    From 0 to PrinterCount-1. | 0 |

### Result

Returns name of printer or error.

### Description

Queries the name of the printer with given index.  
### Examples

Queries name of first printer:

 $name = MBS ( "Printer.PrinterName"; 0 )  
Query list of all printers with While loop:

 Let ( \[   
 count = MBS ( "[Printer.PrinterCount](PrinterPrinterCount.md)" );   
 list = While (   
 \[  
 l = "";   
 i = 0  
 \];   
 i &lt; count ;   
 \[   
 l = l &amp; MBS ( "Printer.PrinterName"; i ) &amp; ¶;   
 i = i + 1   
 \] ; l )  
 \]; list )  
Create records from printer list:

 # List printers in file Printers   
  
Delete All Records \[ With dialog: Off \]  
Set Variable \[ $count ; Value: MBS ( "[Printer.PrinterCount](PrinterPrinterCount.md)" ) \]   
If \[ $count &gt; 0 \]   
 Set Variable \[ $index ; Value: 0 \]   
 Loop  
 New Record/Request  
 Set Variable \[ $name ; Value: MBS ( "Printer.PrinterName"; $index ) \]   
 Set Field \[ Printers::Printer Name ; $name \]   
 #   
 Commit Records/Requests \[ With dialog: Off \]   
 #   
 Set Variable \[ $index ; Value: $index + 1 \]   
 Exit Loop If \[ $index ≥ $count \]   
 End Loop  
End If  
### See also

- [DynaPDF.Print](DynaPDFPrint.md)
- [Printer.PaperFormats](PrinterPaperFormats.md)
- [Printer.PaperSources](PrinterPaperSources.md)
- [Printer.Print](PrinterPrint.md)
- [Printer.PrinterCount](PrinterPrinterCount.md)
- [Printer.PrinterInfo](PrinterPrinterInfo.md)
- [Printer.PrinterNames](PrinterPrinterNames.md)

### Release notes

- **Version 9.0**
    - Improved out of bounds error message for [Menu.InsertItem](http://www.mbsplugins.eu/MenuInsertItem.shtml), [Menu.RemoveItemAtIndex](http://www.mbsplugins.eu/MenuRemoveItemAtIndex.shtml), [Calendar.Item.GetAttendeeURL](http://www.mbsplugins.eu/CalendarItemGetAttendeeURL.shtml), [Calendar.Item.GetAttendeeCommonName](http://www.mbsplugins.eu/CalendarItemGetAttendeeCommonName.shtml), [Calendar.Item.GetAttendeeStatus](http://www.mbsplugins.eu/CalendarItemGetAttendeeStatus.shtml), [Printer.PrinterName](http://www.mbsplugins.eu/PrinterPrinterName.shtml) and [CLGeocoder.PlacemarkValue](http://www.mbsplugins.eu/CLGeocoderPlacemarkValue.shtml).

### Example Databases

- [Mac and iOS/PDFKit/PDFKit Print Documents](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDFKit%20Print%20Documents.shtml#3ScriptAnchor_)
- [Printers/Printer Info](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Printers/Printer%20Info.shtml#2ScriptAnchor_)
- [Printers/Printers](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Printers/Printers.shtml#1ScriptAnchor_)

### Blog Entries

- [Control printing in FileMaker with MBS Plugin on MacOS](https://www.mbsplugins.de/archive/2023-06-11/Control_printing_in_FileMaker_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.6pr2](https://www.mbsplugins.de/archive/2018-12-05/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr8](https://www.mbsplugins.de/archive/2012-11-14/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2017, Seite 21](https://filemaker-magazin.de/neuigkeit/3961-Appetithappen-FMM_201705)

This function checks for a license.

Created 18th August 2014 , last changed 19th September 2021

  
[Printer.PrinterInfo](PrinterPrinterInfo.md) - [Printer.PrinterNames](PrinterPrinterNames.md)

[HTML Version](PrinterPrinterName.shtml)