It looks like something is wrong with the way MetaCard is capturing the
htmlText of your original field. You should probably submit this as a bug
report. You could probably work around it by setting the htmlText of the
field directly instead of setting the textColor.

As an aside, your code could be a lot simpler, although it won't affect the
outcome. To set selected text the way you want, all you need is:

on mouseUp
   set the textcolor of the selectedChunk to "blue"
   set the textstyle of the selectedChunk to "bold,group"
end mouseUp



> -----Original Message-----
> From: rice [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 21, 1999 4:20 AM
> To: [EMAIL PROTECTED]
> Subject: HTML text
> 
> 
> Well here I am again, not a clue as to what is happening. 
> Sorry this is so
> verbose but I want to provide enough information that this 
> can be solved.
> 
> I want to create files which have bold, group, blue text 
> which can be used as
> hypertext. I enter the text into a field and then select the 
> text I want to
> appear as hypertext and then click the button with the 
> following script.
> 
> Hypertext button:
> on mouseUp
>   global L, S
>   get the selectedtext of cd field "textcontent"
>   put word 2 of the selectedchunk  into S
>   put word 4 of the selectedchunk into L
>   set the textcolor of char S to L of cd field "textcontent" to "blue"
>   set the textstyle of char S to L of cd field "textcontent" 
> to "bold,group"
> end mouseUp
> 
>  The text is set to bold,group,blue. Once I have all the 
> hypertext created I
> then save this file with the following script.
> 
> save the HTML file:
> on mouseUp
>   global thefilename
>   open file thefilename
>   write the htmltext of cd field "title" & "�" to file 
> thefilename -- no Htxt
> actually in this field
>   write the htmlText of cd field "textcontent"  & "�" to file 
> thefilename --
> this is the Htxt field
>   write the htmlText of cd field "links"  & "�"  to  file 
> thefilename -- no
> Htxt actually in this field
>   write the htmlText of cd field "images" to  file 
> thefilename -- no Htxt
> actually in this field
>   close file thefilename
> end mouseUp
> 
> Then in another stack I have a list of these files and the 
> user can click on a
> file name and the file is loaded into a field. The idea is 
> they will see the
> bold,blue txt and when they click on it the field script will 
> process it and do
> something.
> Load an HTML file:
> on mouseUp
>   global thefilename
>   set itemdel to "�"
>   open file thefilename
>   read  from file thefilename until eof
>   close file thefilename
>   set the htmlText of cd field "title" to item 1 of it
>   set the htmlText of cd field "textcontent" to item 2 of it
>   set the htmlText of cd field "links" to item 3 of it
>   set the htmlText of cd field "images" to item 4 of it
> end mouseUp
> 
> Now here's the deal, the hypertext is all screwed up. If the 
> hypertexted word
> or phrase is the only one in a line it's OK. Like this:
> <B><GROUP><FONT color="#0000FF">yellow curve on 
> graph</FONT></B></GROUP>
> If two or more hypertexted words or phrases appear in the 
> same line then the
> HTML tags are incorectly located, like this:
> <B><GROUP><FONT color="#0000FF">neutrophils</FONT></B></GROUP>,
> <B><GROUP></FONT><FONT>eosinophils</B></GROUP>
> 
> Note where the second </FONT> occurs. Can anyone suggest how 
> I can fix this?
> This isn't a bug is it? I'm using MC 2.2.5 on a Mac OS 8.5
> 
>  Thanks
>  Rick
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

Reply via email to