Text and html text

Richmond richmondmathewson at gmail.com
Wed Jul 17 10:42:26 EDT 2013


On 07/17/2013 03:46 PM, Graham Samuel wrote:
> I was asked to do some editing of a field with a lot of text in it in someone else's program. The field consists of lines, some of which are in the default color (black) and some in red. I couldn't find a reliable way of doing find and replace on the field in situ, so I copied the whole contents and pasted it into a simple text editor (TextEdit on the Mac). All the text came across, but when I'd edited it and pasted it back, it didn't look the same (for example, the line spacing looked wrong). I then looked at all the properties of the original field (prior to my edit), where the text was revealed to be the htmlText of the field, with included paragraph (<p>) and color markers etc. I copied that into TextEdit, edited it and tried to paste it back - but I could see all the markers. I realised that I had somehow replaced htmlText with plain text in the field. I then tried to correct this by executing the following in the message box:
>
> set the htmlText of fld "MyField" to the text of fld "MyField"
>
> Nothing happened.
>
> How can I get back to the original situation after editing the text?
>
> TIA
>
> Graham
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

How about exporting the field contents as HTML. mucking around with the 
resulting html document with either a text editor or a dedicated html 
editor, and then importing the html document back into the field?

Richmond.





More information about the use-livecode mailing list