Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!husc6!endor!olson From: olson@endor.harvard.edu (Eric K. Olson) Newsgroups: comp.sys.mac.programmer Subject: Re: Capturing ASCII PostScript programatically? Message-ID: <1644@husc6.harvard.edu> Date: 16 Apr 89 21:58:18 GMT References: <377@lloyd.camex.uucp> Sender: news@husc6.harvard.edu Reply-To: olson@endor.UUCP (Eric K. Olson) Organization: Lexington Software Design, 72A Lowell St., Lexington, MA 02173 Lines: 34 In a recent article Kent Borg writes: >Though the question still comes up weekly, we all pretty much know how >the *user* can get PostScript output sent to a file rather than the >LaserWriter, but is there a way for a *program* to do it? > >I see about 4 ways: 1) find the hidden bit that tells the LaserWriter >driver to do that (I hope, I hope...), 2) fake-out the driver with a >synthetic LaserWriter--either in the same Mac, or in another machine >on the net (sounds like a lot of work, but could even be >Chooser-friendly), 3) pretend to be the user and do the command-K >business (sounds terrible, but might not be *that* bad), and 4) write >my own driver which does this (cheating--avoids the question, and too >much work). I looked into this once and found that the Laserwriter print routines check for command-K and command-F by looking at the boolean array returned by GetKeys() [IM I-259]. In fact, it doesn't check the command key, so just hitting K or F works too. It's not very Mac-like, is it? Perhaps if you patch GetKeys, you can convince it to dump Postscript files. The check might be between PrJobDialog() and the time you get control back, so you'll have to avoid messing up normal keyboard activity with the patch. I'm not sure GetKeys() is used by the event manager, though. Good Luck! -Eric Lexington Software Design: Tomorrow's Software Yesterday Eric K. Olson olson@endor.harvard.edu harvard!endor!olson (Name) (Arpanet) (Usenet)