How to View Raw HTML Tagged Text as HTML

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm
Location: Las Vegas, NV

How to View Raw HTML Tagged Text as HTML

Post by deeverd » Thu Apr 03, 2014 4:48 pm

Hello RunRev Internet Forum,

I've been unsuccessfully experimenting with trying to do the following:

First, create a plain text field out of a field that originally contained styled text so I can view the HTML tags in it. This I can do with no problem.

Second, edit the raw HTML tags by hand and then attempt to re-view that page as styled HTML. Part two here is where I'm having problems.

I'm familiar with the concepts of "get" and "set" when it comes to working with the HTMLText but whenever I do, I just see another plain copy of raw HTML tags in plain text.

How do I view these changes as styled HTML again? Is this a browser function? A clipboardData function? So far, any solution has eluded me.

If anyone has a working solution to this problem, it would be greatly appreciated.

All the best,
deeverd

Klaus
Posts: 13866
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to View Raw HTML Tagged Text as HTML

Post by Klaus » Thu Apr 03, 2014 6:17 pm

HI deeverd,

I think you are looking for something like this:
...
set the htmltext of fld "really styled htmltext display" to the text of fld "the field with the raw html tag stuff"
...
You get the picture :D


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4027
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: How to View Raw HTML Tagged Text as HTML

Post by bn » Thu Apr 03, 2014 6:17 pm

Hi deeverd,
First, create a plain text field out of a field that originally contained styled text so I can view the HTML tags in it. This I can do with no problem.
assuming that you have two fields
The first is the one you have pasted html-formatted text to and it now appears formatted as the html would demand.
Then you have transfered the htmltext of field 1 to field 2 by

Code: Select all

put the htmlText of field 1 into field 2
now you edit the html in field 2 and then, here is the magic

Code: Select all

set the htmlText of field 1 to the text of field 2
now your changes to the formatting should appear in field 1.

Kind regards
Bernd

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm
Location: Las Vegas, NV

Re: How to View Raw HTML Tagged Text as HTML

Post by deeverd » Thu Apr 03, 2014 7:32 pm

Hello Klaus and bn,

It works like a charm. Thank you so much! It's such a simple solution that I'm almost embarrassed that I needed to ask (right now I'm happy enough to have a solution that it's Ok to be embarrassed). What fooled me was setting field 1 to the "text" of the plain field with the html tags. I assumed that because the plain field contained html information (howbeit as tags), I would have to set it to the htmlText of the plain field. No wonder it didn't work originally.

Thanks again for enlightening me.
All the best,
deeverd

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Location: Rome, Italy
Contact:

Re: How to View Raw HTML Tagged Text as HTML

Post by andy60 » Sun Feb 08, 2015 6:21 am

bn wrote:Hi deeverd,
First, create a plain text field out of a field that originally contained styled text so I can view the HTML tags in it. This I can do with no problem.
assuming that you have two fields
The first is the one you have pasted html-formatted text to and it now appears formatted as the html would demand.
Then you have transfered the htmltext of field 1 to field 2 by

Code: Select all

put the htmlText of field 1 into field 2
now you edit the html in field 2 and then, here is the magic

Code: Select all

set the htmlText of field 1 to the text of field 2
now your changes to the formatting should appear in field 1.

Kind regards
Bernd
hi tell me about the following code, i have no data in txt file:

Code: Select all

on mouseUp 
   local myGoo
   put "<title>pippo</title>" into myGoo
   open file specialFolderPath("desktop") & "/myGooData.txt" for write 
   write myGoo to file specialFolderPath("desktop") & "/myGooData.txt" 
   close file specialFolderPath("desktop") & "/myGooData.txt" 
end mouseUp
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Klaus
Posts: 13866
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to View Raw HTML Tagged Text as HTML

Post by Klaus » Sun Feb 08, 2015 12:47 pm

Hi Andy,

please do not try to revive a dead and solved thread, create a new one! 8)

And use BRACKETS ALWAYS when creating/concatenating pathnames and objectnames:
-> open file (specialFolderPath("desktop") & "/myGooData.txt") for write

Maybe you like to save some typing and use the URL syntax:

Code: Select all

on mouseUp 
   put "<title>pippo</title>" into url("file:" & specialFolderPath("desktop") & "/myGooData.txt")
   ## Done :-)
end mouseUp

Best

Klaus

Post Reply

Return to “Internet”