[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Outputting to a printer



At 08.19 -0500 1999.01.07, Larry Moore wrote:
>Is there a simple way of directing a file output to the printer using
>mac.perl?

What kind of file?  A PostScript file can be sent directly to a PostScript
printer with MacPerl (examples are in the MacPerl book and docs, I think).
Other than that, you can use Apple Events or AppleScript to direct a
program to print something.  Tested to work with SimpleText (ttxt) and
BBEdit 5.0 (R*ch):

    #!perl -w
    use Mac::Files;
    use Mac::AppleEvents::Simple;
    do_event(qw/aevt pdoc ttxt/, q"'----':alis(@@)",
        NewAliasMinimal('Bourque:Desktop Folder:test'));

You can do more complicated events to print active windows, and specify
printing options, etc.  But it depends on the target app.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch