Related example macro: Demo-Print
iMacros includes a PRINT command that triggers a print dialog. At this point, the dialog manager takes over with the values defined in the ONPRINT command. Thus you can select a specific printer by using ONPRINT P=3. In this case, the third printer is used. If you use only P= or P=* the most recently selected printer is used. Typically this is the default windows printer (The only exception to this rule is if you select another printer before (e. g. with P=3) then printer #3 is the default printer during this iMacros session.).
If the page uses frames and you want to print only a specific frame, select this frame with WINCLICK first.
Example:
VERSION BUILD=4020412
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://www.iopus.com/imacros/demo/frames.htm
SIZE X=644 Y=604
FRAME F=6
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:frame7.htm ATTR=NAME:T1 CONTENT=Print<SP>this<SP>frame<SP>only
'Make winclick to select frame
WINCLICK X=462 Y=206 CONTENT=
ONPRINT P=*
PRINT
Page URL http://www.iopus.com/imacros/help/print.htm