[comp.sys.mac.hypercard] PostScript from HyperCard?

dnewman@emx.utexas.edu (David Newman) (09/09/90)

Having modified my Laserwriter Driver so that I can create postscript
files from most applications, I notice that HyperCard uses a different
dialog box, and that I don't remember the command-kay sequence that
tells the driver to make the postscript file without using the 'hidden'
(now un-hidden) check-box.  Can someone refresh my memory as to what the
proper incantation is, and can anyone verify that the incantation works
with HyperCard?

The basic problem is that I want to make some postscript files from a
HyperCard stack and print them from a Unix system.  Any hints are apprecciated.

Thanks,

>>Dave

bhall@pbs.org (Dark Star) (01/10/91)

Does anyone know of a way to send PostScript files to a printer from within
HyperCard?  I would like to modify some hand-crafted PostScript with a stack
and then send the resulting code to a printer.

Thanks.
 
--
Bruce Hall                     Domain: bhall@pbs.org
Public Broadcasting Service    UUCP:...{uupsi,vrdxhq,csed-1,ida.org}!pbs!bhall
                               Phone: 703/739-5048
"Experience is the name everyone gives to their mistakes" - Oscar Wilde

mandel@vax.anes.tulane.edu (Jeff E Mandel MD MS) (01/10/91)

In article <1991Jan9.144445.11269@pbs.org> bhall@pbs.org (Dark Star) writes:
>
>
>Does anyone know of a way to send PostScript files to a printer from within
>HyperCard?  I would like to modify some hand-crafted PostScript with a stack
>and then send the resulting code to a printer.
>
I have an XCMD which does this, but it is not documented and not tolerant of
sloppy usage. I was planning on cleaning it up, documenting it and submitting
it to MacTutor, but if enough people mailed me and said it was a $5 shareware
XCMD they'd pay for, I would find time for it.

Basically, the XCMD takes advantage of the PREC 103 mechanism to persistantly
download a set of postscript procs, then uses QuickDraw comments to invoke
these routines. It was designed to print form letters, so that each letter
could be generated with a short postscript call, i.e. (Dr. Mandel)doForm. Thus,
the XCMD is set up to open a job, then accept an arbitrary number of pages,
then close the job.
It depends on some globals (myPrintRecord,myPrinterPort) to hold the print job
open.
If these globals are empty, a new job is started (i.e. the user is presented
with the print dialog for the printer selected in Chooser), if the first
parameter is false, the job is left open, if true, it is closed.
Thus:

on mouseUp
  global myPrintRecord,myPrinterPort
  put empty into myPrintRecord
  put empty into myPrinterPort
  put the number of lines in card field "Names" into theNum
  repeat with i = 1 to theNum
    put "(" & line i of card field "Names" & ")doForm" into thePostScript
    if i is theNum then
      SendPS true,thePostScript
    else
      SendPS false,thePostScript
    end if
  end repeat
end mouseUp

Needless to say, it is dangerous to leave dangling print jobs, so the
programmer should beware of permitting the user to leave the stack without
closing the print job.

The mail merge which I wrote this for was over 300 names a month, and was
taking a full day for a secretary with a Mac Plus (2.5 meg RAM) and a
LaserWriter II NTX to do with Word 4.0. It now takes about an hour. Real gee
whiz stuff.

Jeff E Mandel MD MS
Asst. Professor of Anesthesiology
Tulane University School of Medicine
New Orleans, LA

Disclaimer: "I'm too tired to think of something clever"