G’day scripters
Problem…
I’m trying to direct print with textEdit, and Acrobat Pro .
The handlers I’m using seem to work fine on my iMac, but not on my Clients 2012 Mac Pro, both running Yosemite.
If they set the paper size of the TextEdit Print dialog to A4 (which it’s supposed to be), then Acrobat prints on A4 instead of A3 (TextEdit first prints what we call a ‘cover sheet’ on A4 first, with barcode and email details).
TextEdit’s Print dialog has a target printer set to the name of the Small Page Printer, and Acrobat uses (supposedly), the Large Page Printer. These names are set in a set-up window which allows direct selection from the ‘Printer & Scanner’ preferences list.
Is anyone able to tell me what I might be doing wrong in the code please? For instance, should I be using the CUPS printer names instead of the spaces-included-instead-of-underscores Printer names?
Regards
Santa
on printTextEdit() try set TempAttachmentName to my ResetAttachmentName() tell application "TextEdit" try activate open file (my theItem) as alias print document 1 with properties {target printer:TheCoverPagePrinter} without print dialog —< ‘Small Page Printer' end try end tell on error errmsg set my didItPrint to false tell application "System Events" to display dialog "printTextEdit " & return & return & errmsg giving up after 40 end try end printTextEdit
Acrobat Handler
try tell application "Adobe Acrobat Pro" activate do shell script ("sleep 0.1") set CountOfPages to count of pages of active doc do script "var pp = this.getPrintParams(); pp.numCopies = 1; pp.shrinkToFit = false; pp.firstPage = 1; pp.lastpage = " & CountOfPages & "; pp.tileOverlap = 36; pp.tileLarge = true; pp.tileMark = pp.constants.tileMarks.west; pp.setPageSize = '" & largePaperSize & “'; —< ‘A3' pp.printerName = '" & theLargePagePrinter & “'; —< ‘Large Page Printer' pp.interactive = pp.constants.interactionLevel.silent; this.print(pp);" end tell on error errmsg number errnum set my didItPrint to false tell application "System Events" to display dialog " printAdobeAcrobat 2 " & errmsg & return & "error number " & errnum giving up after 40 end try
|