5 Replies Latest reply on Jan 23, 2012 5:30 AM by beverly

    'Set Field By Name' issue resolved - RTF to HTML solution

      Hi All,

       

      being a newbie I find this forum very useful and I am grateful to all contributors.

       

      I have found a scripting solution to create html from rich text fields.

      I started to collect my explorations in my blog at ralfw.weebly.com and I thought I might share my findings here.

       

      Is the link acceptable or would it be required to put the solution into this message directly?

        • 1. Re: 'Set Field By Name' issue resolved - RTF to HTML solution

          Oops

           

          I didn't get the link right - lets try again:

               ralfw.weebly.com

          • 2. Re: 'Set Field By Name' issue resolved - RTF to HTML solution
            LyndsayHowarth

            Hi Ralf,

             

            Now I know you are a man who (as your web site says) loves "reinventing the wheel"...

             

            But I thought I might ask what the advantage is here over just using getascss(text) with a top & tail html/head/body tags ...?

             

            - Lyndsay

            • 3. Re: 'Set Field By Name' issue resolved - RTF to HTML solution
              beverly

              I'm also not sure why you'd do it that way, Ralf. I'm not a fan of GetAsCSS() without some serious tweaking (it's doesn't seem xhtml compliant, for example). But it does what you want (mostly) as is.

               

              Beverly

              • 4. Re: 'Set Field By Name' issue resolved - RTF to HTML solution

                Hi Lyndsay and Beverly,

                there is indeed no advantage over getascss(text)  (thanks for that hint - I hadn't thought of trying it that way).

                 

                The reason for me to explore this is that I want to use Filemaker for the maintenance of a dictionary of some sort:

                On this website  m-tarot.net I make use of a dictionary (open the 'Card Description' accordion tag). To generate the website I use an algorithm to automatically insert span tags when finding a keyword in the 'Card Description' text.

                 

                To enable easy maintenance of multiple keywords for the editor I want to use Filemaker in a similiar way: marking a word within a text and showing some dictionary data (when clicked?). I can underline a word (or two or three) when there is a dictionary entry referred to already - and perhaps show it when clicked. And also to allow easy adding of selected word(s) as key for a dicionary entry.

                (there is a many-to-one table with the keywords as key).

                 

                I think without MiddleValues and GetAsCSS this would be difficult if not impossible. To find these not so obvious thing I need to 'reenvent the wheel' - I learn a lot when I do this.

                 

                I admit that converting the entire text - as I did in my sample - can easily bring up the question as to why. Also I hadn't thought of trying to convert the entire text.

                 

                Thank you for your interest.

                • 5. Re: 'Set Field By Name' issue resolved - RTF to HTML solution
                  beverly

                  OK! I'd come up with a solution for a client a long time ago. They could select a word or phrase and a script would ask for a link. It would then insert the link into the text as an HTML hyperlink. I did the same thing with bold, underline and other text formatting - adding HTML/CSS to the selection. The "selected" would be the only thing that got changed in the entire text field. Actually, there was a trick, as there were two fields, one "human-readable" and one with the HTML. The HTML fields were used to update a website.

                   

                  Beverly

                   

                  p.s. this was *before* GetAsCSS()...