[comp.sys.mac.hypercard] Printing card field

palkovic@linac.fnal.gov (09/13/90)

How do I print a card field? Preferably with a button. I have a
Hypercard stack that I use to read mail. Each mail message has it's
own card. I would like to have a button named "Print Message" to print
the current message. It is in a card field.

adv<thanks>ance

gt0831c@prism.gatech.EDU (William Moss) (09/14/90)

While I know of no easy way to do this in standard (pre 2.0)
Hypercard, the Dartmouth XCMD's version 3.1 have two VERY good
XCMDs for printing card fields.

PrintField (by Kevin Calhoun)  prints the text of a field in its current
     font, size, style, height and width. Further information about
     page margins and whether to invoke the standard print dialogs can
     also be specified (margins on this XCMD are in points).

TextStream (also by Kevin Calhoun) prints groups of containers (variables,
     fields, scripts, etc.) in the printer's default font. It has a
     provision to set margins (but unlike PrintField these margins
     are in terms of characters and lines). There is no way to force
     the dialog boxes to appear.

Both XCMD's work on the Laserwriter and Imagewriter.
The Dartmouth XCMD's verison 3.1 stack is available via
anonymous ftp from sumex-aim.stanford.edu as freeware.

Does anyone know whether these XCMDs work with Hypercard 2.0

William Moss

bc@Apple.COM (bill coderre) (09/14/90)

In article <2303@linac.fnal.gov> palkovic@linac.fnal.gov writes:
|How do I print a card field? Preferably with a button. I have a
|Hypercard stack that I use to read mail. Each mail message has it's
|own card. I would like to have a button named "Print Message" to print
|the current message. It is in a card field.

In HC 1.2.5:
on PrintMessage fieldlongname
  -- first write the field to a file
  open file "tempfoo"
  write fieldlongname to "tempfoo"
  close file "tempfoo"
  --now use another application to print the file
  print "tempfoo" with "teachtext"
end PrintMessage

in HC 2.0:
on PrintMessage fieldlongname
  open printing
  -- choose one of the following two lines:
  print fieldlongname -- with formatting intact
  print (fieldlongname) -- with no formatting
  close printing
end PrintMessage

pretty neat, eh?

bill coderre
private consultant for hire

jkc@Apple.COM (John Kevin Calhoun) (09/14/90)

Yes, PrintField and TextStream work with HyperCard 2.0.  I tested
them myself.


- Guess Who