[comp.sys.mac.hypercard] HC script to create MS Word RTF format?

langford@reed.UUCP (Chris Langford) (05/12/89)

I have information stored in a HyperCard stack that I often save to
a file on disk.  Then I open the file with Microsoft Word, and have to 
format the entire thing.

Does anyone out there have a script or XCMD that can download text in
Word's RTF format?  I decided to whip one up myself, thinking it would
be a simple thing to do.  Then I looked at a file in that format.  Silly
me.

If no one else has done it, I will probably send away to Microsoft for the
format and do it myself.  But I figured I should ask the net first, so as
not to duplicate work (and save myself a hell of a lot of it  :-).

Thanks in advance...

-- 
Chris Langford  {backbone}!tektronix!reed!langford -or- langford@reed.bitnet

"Come on out, or the kid gets it!"  -Crazy man in "The Quiet Earth", pointing
				     a shotgun at a large Jesus-on-the-cross.

milliken@bbn.com (Walter Milliken) (05/12/89)

In article <12720@reed.UUCP>, langford@reed (Chris Langford) writes:
>I have information stored in a HyperCard stack that I often save to
>a file on disk.  Then I open the file with Microsoft Word, and have to 
>format the entire thing.
>
>Does anyone out there have a script or XCMD that can download text in
>Word's RTF format?  I decided to whip one up myself, thinking it would
>be a simple thing to do.  Then I looked at a file in that format.  Silly
>me.
>
>Chris Langford  {backbone}!tektronix!reed!langford -or- langford@reed.bitnet

I had a similar problem.  The way I solved it was to use Word to
create a sample document with a few examples of the stuff I wanted
formatted, with all the styles defined that I wanted.  Then I looked
at the output file and figured out what surrounded the data I wanted
Hypercard to write.  Basically, the Word RTF file contains a long
preamble defining a lot of stuff, and then your text with occasional
commands interspersed.

What I did was cut the RTF preamble from the sample document and
pasted it into a Hypercard script, editing it to become a string
literal.  I then took the "Export Text" button (I think it was) and
modified the script to emit the RTF preamble string, and also to stick
in the various formatting commands between fields, following the
template of the sample document.

The only real problem with this approach is that it's slow.  I think
it could only output about one card every 20 seconds in RTF format.
Of course, I was doing a little additional processing on the data
while I was emitting it -- there was some conditional formatting in
the RTF document based on whether certain fields were empty.

---Walter