[mod.computers.laser-printers] Postscript Escape Restriction

herbw@midas.tek.CSNET.UUCP (07/31/86)

--------
The new Postscript Escape mechanism provided by the latest System/LaserWriter
is quite useful.  Unfortunately, there seems to be a serious restriction when
using this facility (I encountered the problem with MacWrite).

What I want to do is draw a box around some text (which is entirely contained
on a single page).  My plan was to save the current x and y coordinates at the
beginning of the text (using currentpoint) and draw the box at the end of the
text.  Unfortunately, the postscript code supplied as Postscript Escape gets
bracketed (by the LaserWriter driver?) with psb (defined as {/us save def})
and pse (defined as {us restore}).  Aha, I thought: I'll cheat by placing a
pse at the beginning of my code, and a psb at the end, which should cause the
save and restore to have no effect.  Alas, the code still did not work.  Is
MacWrite perhaps imbedding other saves and restores in its cryptic output?
Or am I doing something dumb?  The following is my Postscript code:

At the beginning of the box:
 pse currentpoint /tly exch def /tlx exch def psb

At the end of the box:
 currentpoint /bry exch def /brx exch def .72 setlinewidth newpath
 tlx tly moveto brx tly lineto brx bry lineto tlx bry lineto closepath stroke

                                  Hopefully,
                                  Herb Weiner