Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!bbn!milliken@bbn.com From: milliken@bbn.com (Walter Milliken) Newsgroups: comp.sys.mac.hypercard Subject: Re: HC script to create MS Word RTF format? Keywords: RTF Microsoft HyperCard Script XCMD Message-ID: <39870@bbn.COM> Date: 12 May 89 15:57:32 GMT References: <12720@reed.UUCP> Sender: news@bbn.COM Reply-To: milliken@bbn.com (Walter Milliken) Organization: BBN Advanced Computers, Inc. Cambridge, MA Lines: 34 In-reply-to: langford@reed.UUCP (Chris Langford) 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