How to use PrinterSwitch “Capture & Restore” on Mac OS X

Warning: copy(): Filename cannot be empty in C:\inetpub\\wp-content\plugins\mytube\mytube.php on line 220

PrinterSwitch "Capture & Restore", or the ability to store and later retrieve printer settings like page orientation, paper size and paper source, has been available on Windows since version 1.5.

The recently released PrinterSwitch 2.0 now offers these options on Mac OS X as well. In this article, we'll focus on how you can implement this.


How does it work ?

1° First of all, download our example file and make sure the plug-in is installed. PrinterSwitch is available for download here.

2° Open the example file

The first thing you need to do is "Define printer settings". Once you have "captured" these, you will be able to "restore" them at the time of printing.

3° Select a printer from the pop-up menu, then click the "Define Settings" button. This will run the "Add new printer settings" script. The screenshots below will guide you through the process.


4° Enter a name, preferably with a description of what's specific about that setup.

On Windows, the next step in the script is Print Setup [].
Because of the nature of how print settings can be selected on the Mac (certain parts in the "Page Setup" and others in the "Print" dialogs), we created a specific PrinterSwitch function to mimic the Windows [Print Setup] script step on the Mac: PrSw_PrintDialog ("macdialog").


When calling this function, you will get two 'dummy' dialogs - first the "Page Setup" dialog, then the "Print" dialog.


5° Make all necessary selections in both dialogs, such as paper size, orientation, scaling, duplex, n-up printing, paper feed etc.


6° Once you have finished making your selections, click "Print".
The function will return "0" if the user first clicks "OK", and then clicks "Print". Otherwise, if the user cancels either the page setup or print dialog, it will return "-1".

IMPORTANT NOTE: Clicking "Print" will NOT send a print job to the printer. It allows you, however, to go and capture all these settings using the function PrSw_PrintSetup("capture"). When you call this function, a long string will be stored in a printer settings field.

You can repeat this process for other printers or printer settings you want to capture.

7° In order to print with a particular setting you stored previously, use the function
PrSw_PrintSetup("restore|" & [printersettingsstring] )
followed by a normal
Print [No Dialog]
script step…


IMPORTANT NOTE: on Windows, instead of the one Print [No Dialog] script step, you need to use the three following steps:

SetVariable [$printersettings; Value:PrSw_PrintDialog( "disable" )
Print []
SetVariable [$printersettings; Value:PrSw_PrintDialog( "enable" )

The PrinterSwitch download also contains an example file that demonstrates how you could implement printer settings on a "per user"or "per computer" basis.

Leave a Reply

You must be logged in to post a comment.