Printing files with «folder action» scripts ...

I won’t hurt to also specify letter size paper. So your final lrp line would look like:

do shell script "usr/bin/lpr -P " & myPrinter & space & destinationFilePath & " -o media=letter -o page-left=36 -o page-right=36 -o page-top=36 -o page-bottom=36"

Just looked at the MAN page for lpr. There is an option “-l” that might be worth trying before you put in all of those margins.

-l Specifies that the print file is already formatted for the destination and should be sent without filtering.

do shell script "usr/bin/lpr -P " & myPrinter & space & destinationFilePath & " -l -o media=letter"

Thank you very much both … I will put that all together tonight and keep you posted.

Regards.

Robert

Matt-Boy,

do shell script "usr/bin/lpr -P " & myPrinter & space & destinationFilePath & " -l -o media=letter"
do shell script "usr/bin/lpr -P " & myPrinter & space & destinationFilePath & " -l"

Printing with either statement above, returns garbage … I get no readable document. What I don’t understand is that the resulting PDF document is perfect when displayed with Apple’s «Preview».

What is the script that I should use to print the file as it is when I see it in «Preview» or what are the print setup that I should specify to match what I get when I print manually ? Or … what are the print setup used by the shell script when requiring to use «myPrinter» and what can I do to modify them ?

Regards.

Robert

Please read the man page of lpr. The file is supposed to be the last parameter

lpr [ -E ] [ -H server[:port] ] [ -U username ] [ -P destina-
tion[/instance] ] [ -# num-copies [ -h ] [ -l ] [ -m ] [ -o
option[=value] ] [ -p] [ -q ] [ -r ] [ -C/J/T title ] [ file(s) ]

I always put the -o option last and it works fine for me, but that’s worth trying if you are still not getting the correct output.

I have never put multiple -o options however. Maybe Stefan or someone else can confirm that what I put is the correct format.

Apple (bizarrely) does not make their own Preview app scriptable. I have read that the free PDF viewer “Skim” is very script friendly. That might be another option to explore if you can’t make the LPR work.

Hi,

Thank you very much both for your help. I decided to modify the print setup of my OS 9 application. Much eaisier than scripting for this case, since I am really a newbe with shell scripting. The printout is now OK.

Regards.

Robert