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

Re: [MacPerl] Outputting to a printer



At 16.08 -0500 1999.01.07, Larry Moore wrote:
>>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): <snip>
>>You can do more complicated events to print active windows, and specify
>>printing options, etc.  But it depends on the target app.
>
>a) By simple substitution, this will cause SimpleText to print a dragged_on
>text file:

>        NewAliasMinimal($ARGV[0]));

Right.


>b) Now, do_event wants a filename for its third parameter, and I'd like to
>print the clipboard contents.

Well, you can do this:

  # untested code
  package Dartmouth;
  MacPerl::LoadExternals('clipboard.XFCN');

  package main;
  my $file = $ENV{TMPDIR} . time();
  open(TEMP, "> $file") or die $!;
  print TEMP Dartmouth::Clipboard();
  close(TEMP);

And then use NewAliasMinimal($file).  That might work.

--
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