Handles print dialogs. The ONPRINT command must appear before the PRINT command which triggers the printer dialog to come up.
ONPRINT P=n BUTTON=(PRINT|CANCEL)
- Specifies the number of the printer to use in the drop down list. If you use only P= or P=* the most recently selected printer is used. Typically this is the default windows printer.
- Related forum post: How to determine the printer number.
- Specifies the button on the Print dialog. By default the PRINT button is selected. With CANCEL the dialog is canceled and no page is printed. The CANCEL option is useful if you want to cancel a print dialog that was triggered by a website automatically.
Select the third printer in the list and print the page:
URL GOTO=https://imacros.net ONPRINT P=3 PRINT
Cancel a Print dialog that appears: