Problem with Imbedded file

Charles Szasz cszasz at mac.com
Mon Apr 9 18:25:28 EDT 2007


I saved a RTF file as a custom property of my app stack with the  
following code:

   answer file "Store which file?" --> I selected the file  
"template.rtf"
   set the customPropertySet of this stack to empty
   set the uRtFile of this stack to url ("file:" & ".rtf")
   set the uShortFilename of this stack to last item of it
   save this stack

This script works. The following script also works. It opens the RTF  
file  to add field information from my card to the fields in the .rtf  
file.

   put the effective filename of this stack into tPath
   set the itemdelimiter to "/"
   put "template.rtf" into last item of tPath
   put URL ("file:"& tPath) into tRTFdata

   ---------> Code to fill fields.

   if field "vmiFld" of card "index" > ""
   then
     replace "(1)" with the rtftext of field "vmiFld" of card "index"  
in tRTFdata   																
   else
     replace "(1)" with "" in tRTFdata
   end if

   etc.....

Then export the RFT file:

   ask file "Save file as:"
   put it into tNewFilePath
   put tRTFdata into URL ("file:" & tNewFilePath & ".rtf")

This export code works in the IDE of Rev 2.7.4 . However, it does NOT  
work in the standalone! I get the message that I cannot open the RTF  
file using TextEdit after I export the file.

I have been working on this for four days with the same results. I  
would appreciate ANY suggestions!


Charles Szasz
cszasz at mac.com






More information about the use-livecode mailing list