Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples
New in version: 9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3    Statistic  


Switches printer or changes paper setup.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Printer 6.5 No Yes No No No
MBS( "Printer.SetPrinter"; Printer { ; CloseDialog; Paper Format; Paper Orientation; Paper Source } )   More


Parameter Description Example value
Printer The printer name to set.
Must not match exactly, just the first letters.
Leave empty to not change printer.
CloseDialog Optional
Whether to close print dialog.
Pass 1 to close or 0 to not close.
Pass 2 to press cancel button in case you just want to learn the options.
Paper Format Optional
Available in MBS FileMaker Plugin 10.0 or newer.
The name of the paper format.
Leave empty to not change.
Paper Orientation Optional
Available in MBS FileMaker Plugin 10.0 or newer.
The paper orientation.
Pass portrait or landscape. Empty value leaves setting as is.
Paper Source Optional
Available in MBS FileMaker Plugin 10.0 or newer.
The paper source.
Pass name of setting. Name doesn't need to match exactly, just first letters.
So you can pass "Man" für Manual (English) and Manuell (German).


Returns OK or error.


Switches printer or changes paper setup.
Shows the printer setup dialog and switches target printer or paper settings.
Please use a script pause of at least a second after calling this function to let Windows show the dialogs.

You can later call Print.ErrorLog to detect errors. If Windows ever change dialogs, features may no longer work.

For Mac, please check PrintDialog.Install function.

Version 10.0 of MBS Plugin adds three new parameters paper format, orientation and source. And the plugin fills the internal lists for paper sources, formats and printers.

Source code sponsored by


Switch printer:

Set Variable [$r; Value:MBS("Printer.SetPrinter"; Printer Dialog::Printer Name)]
Pause/Resume Script [Duration (seconds): 2]
Show Custom Dialog ["Result"; MBS("Printer.ErrorLog")]

Change paper to Letter in landscape:

MBS( "Printer.SetPrinter"; ""; 0; "Letter"; "landscape")

See also

Example Databases

Blog Entries

Release notes

  • Version 10.0
    • Added more options to Printer.SetPrinter function to set paper format, orientation and source.

Created 14th November 2016, last changed 21st November 2019

Printer.PrinterNames   -   Process.FrontProcessBundleID

Feedback: Report problem or ask question.

MBS Xojo Plugins