RTF documents as templates

JosepM jmyepes at mac.com
Wed Jun 9 11:18:30 CDT 2010


Hi List,

Here my tests... 
In MacOSX the RTF is RTFD that is a bundle as explained Jan.
 
Showing the contents of bundle you can found one TXT.rtf file that contain
the text and the n files for the asociated images used in the creation of
the file from TextEdit.

Steps.

1 Open TextEdit and create your template using images and positioning using
tables if you need. If not put your text formated as you need.
2 Where you need replace some part, use the [[myreplacedtext1]] using [[ to
open and ]] to close. As Jan show in her link above.
3 Save as RTFD
4 Open from Rev with the following code. The question is to open the TXT.rtf
file and modify it.
5 Open directly from TextEdit and Print using Rev or Applescript.

Pro
No MS Word need.
Easy way to use templates for the user.

Con
Poor alignment format, only tables, so to build some document A4 or Letter
for example you need to check the lines, footers, etc...

on mouseUp
   
   put mactoiso("áàïô_test") into text1
   put "This a long text to see how is showed inside the rtf file" into
description
   put "Bottom text" into footer
   put the system date into tDate
      
   answer file "Where is the template file?"
   if it is empty then exit mouseUp
   
   put it into theTemplateFile
   
   -- Duplicate the file with a new name

   put "TXT.rtf" into tFichero
   put theTemplateFile & "/" & tFichero into tTheFile
   put URL("binfile:" & tTheFile) into theRTFtext
   
   set the fileType to "MSWDRTF "
   
   put merge(theRTFtext) into URL ("binfile:" & tTheFile)
end mouseUp


Salut,
Josep
-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2249102.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list