1 2 Previous Next 19 Replies Latest reply on Jan 10, 2011 8:09 AM by raybaudi

    Creating a text file from a field

    rickaltman

      Title

      Creating a text file from a field

      Post

      I have the need to take the contents of a field and save it out as an HTML file. I could, of course, simply take the contents of the field, open Notepad, paste, and save it out as an HTML file (he says smartassidly), but I would prefer to write a script that does it for me.

      Can this be done? I know about the Troi plug-in that would do this, but I cannot justify the expense for this modest task. Is there a native solution?

       

      Rick A.
      Pleasanton CA

        • 1. Re: Creating a text file from a field
          Sorbsbuster

          The Export Records script step allows you to choose the HTML output format, and to select which fields you want to export.  Does that not do what you want?

          Alan.

          • 2. Re: Creating a text file from a field
            rickaltman

            No, that's not quite right -- that exports every record, not just the current one (which is what I want). More important, the field I have selected already is HTML code; I want to dump it straight to a text file and simply name the text file with an HTML extension.

            To provide a bit more context (b/c there might be an easier way to accomplish this), I have a field that is populated with HTML code to support the SMTP-It plug-in. I would like to be able to view the contents of that field as if it were in a web browser. By sending it off to an HTML file, I can then use the Web viewer to show it to me. That is my ultimate objective: to be able to view in a browser the HTML code that is contained in a field.

             

             

            RA

            • 3. Re: Creating a text file from a field
              philmodjunk

              IF the HTML code is already entered, use the Export Field Contents step and specify the .htm extension.

              • 4. Re: Creating a text file from a field
                rickaltman

                Perfect! I missed that command when I was pouring over the dialog box. That's rock star -- thanks!

                • 5. Re: Creating a text file from a field
                  rickaltman

                  One follow-up, please:

                  Once I execute the export, the Web viewer does not automatically update. In fact, I have to leave the layout or the view and return to it to see the new material. Can the script include some sort of a refresh command?

                  • 6. Re: Creating a text file from a field
                    raybaudi

                    That is my ultimate objective: to be able to view in a browser the HTML code that is contained in a field.

                    So you do not need to export anything.

                    Your text field will contain the html code and a WebViewer with this simple code will do the rest:

                    "data:text/html" & YourTable::YourField

                    On every change of the field YourTable::YourField, you'll be able to see the new material.

                    Note that the above is true with Mac from v8.5 and with Win from v9

                    • 7. Re: Creating a text file from a field
                      FredShowker

                      MODIFICATION TO THE QUESTION...

                      How do you do the ABOVE process, EXPORTING to an individual HTML file?

                      Say you have twenty RECORDS all of which are from a CALCULATION field that has assembled a complete web page in HTML.

                      You want to export them ... resulting in TWENTY HTML FILES.

                      (Not database look-ups ... individual, static HTML files.)

                      Used to use HyperCard to do this for me from an exported FMP file.

                      • 8. Re: Creating a text file from a field
                        rickaltman

                        That is great, Ray -- I'm learning much from this exercise. I note that the Web viewer is not quite as accurate when using the technique that you describe as it is when I refer it to an external webpage. Backgrounds, images, and CSS formatting are not honored.

                        It's great to be able to get a general sense of what the page looks like, and the convenience factor of not having to issue a command to view it is a significant factor. If I were to have and eat the cake, I would want the accuracy that the external reference gives me with the swiftness and ease that the "data:text/html" & YourTable::YourField gives me.

                        • 9. Re: Creating a text file from a field
                          raybaudi

                          Could you write here an example of a "not honored" html ?

                          • 10. Re: Creating a text file from a field
                            rickaltman

                            As I study this more, I now see that the one component that does not seem to be accurately rendered are inline CSS styles. (I was wrong about the background or the images not showing; I didn't have my Web viewer window large enough.) For instance, code like this:

                            <style type="text/css">
                            <!--
                            a, a:hover {
                             color: blue;
                             font-weight: bold;
                             text-decoration:none;
                            }

                            -->
                            </style>

                            is translated literally and shows up as a line of text along the top:

                            a:hover { color: blue; font-weight: bold; text-decoration:none; } -->

                             

                            I can live with that, BTW. Now it's just a matter of curiosity.

                            • 11. Re: Creating a text file from a field
                              raybaudi

                              Try to substitute each " with ' .

                              • 12. Re: Creating a text file from a field
                                rickaltman

                                I tried that just with the CSS declaration and it did not make a difference. I can try it throughout all of the HTML code the next time I create one.

                                • 13. Re: Creating a text file from a field
                                  raybaudi

                                  BTW single or double quotes makes no difference, if the HTML is inside a field.

                                  When you'll have time, post a complete HTML code.

                                  • 14. Re: Creating a text file from a field
                                    rickaltman

                                    Here is the code for one of my emails:

                                    _______________________________________

                                    <style type=

                                    <!--

                                    a:hover {

                                    color: blue;

                                    font-weight: bold;

                                    }

                                    -->

                                    </style>

                                    <body bgcolor="#66cccc" topmargin="0">

                                    <table width="700" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="white">

                                    <tr>

                                    <td colspan="2" valign="top" bgcolor="#66cccc" style="font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 135%"><a href="http://www.betterppt.com"><img src="http://www.betterppt.com/email/logo700.png" width="680" height="52" border="0"></a></td>

                                    </tr>

                                    <tr>

                                    <td valign="top" style="font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 135%">

                                    <p><img src="http://www.betterppt.com/media/spacer.gif" width="1" height="1" /></p>

                                    <p>Dear <<First Name>>,</p>

                                    <style type="text/css">

                                    <!--

                                    a:hover {

                                    color: blue;

                                    font-weight: bold;

                                    }

                                    -->

                                    </style>

                                    <body bgcolor="#66cccc" topmargin="0">

                                    <table width="700" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="white">

                                     

                                    <tr>

                                    <td valign="top" style="font-family: Segoe UI, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 135%">

                                    <p>With just over a month before the Presentation Summit, Oct 17-20, this is the most excited I have ever been in the eight years that we have been doing this. Part of it is serendipity &mdash; San Diego in October is the nicest weather that mainland America might ever know, and we are being hosted by a resort property that promises to be a fantastic experience.</p>

                                    <p>But a bigger part is the program that is in place. Simply put, we have never offered such breadth of coverage before, without sacrificing in any way the meat-and-potatoes content that has been the conference&rsquo;s foundation. Here are a few examples of the great duality we have in our schedule this year:</p>

                                    <p><strong>YIN: </strong>Julie Terberg returns for her incredible makeover sessions, using patron-submitted work.</p>

                                    <p><strong>YANG: </strong>Justin Massengale joins the team to show how he creates cartoon characters in PowerPoint, using nothing but the built-in shape and curve tools.</p>

                                    <p><strong>YIN: </strong>Nancy Duarte is at her cerebral best leading a workshop entitled &ldquo;How to Think Like a Designer,&rdquo; exploring the power and impact of visual communication.</p>

                                    <p><strong>YANG: </strong>Scott &ldquo;Q&rdquo; Marcus leads a session on performance art, which he refers to as &ldquo;sculpting.&rdquo; Those in attendance will be up out of their chairs most of the time.</p>

                                    <p><strong>YIN: </strong>Wayne Michael shows how to create something out of nothing in his workshop &ldquo;Your Very Own Smart Art.&rdquo;</p>

                                    <p><strong>YANG: </strong>Carmen Taran shows how to create nothing out of something (and be the better for it) in her afternoon keynote &ldquo;The Psychology of Absence.&rdquo;</p>

                                    <p><strong>YIN: </strong>Echo Swinford discusses her favorite features of the new version of PowerPoint.</p>

                                    <p><strong>YANG: </strong>Microsoft Program Manager Christopher Maloney shares his favorite features and shows how he and his team use the program.</p>

                                    <p><strong>YIN: </strong>Ric Bretschneider will go until near midnight in his traditional Guru session Monday night.</p>

                                    <p><strong>YANG: </strong>Garr Reynolds will wake up at 1:00a in his morning to address the group Tuesday at 8:30a.</p>

                                    <p><strong>YIN: </strong>Glen Millar shows the big impressions you can make by integrating video.</p>

                                    <p><strong>YANG: </strong>Jeff Vyduna shows how small you can go with today&rsquo;s amazing micro technology.</p>

                                    <p><strong>YIN: </strong>Over a dozen vendors will show off their goods and services all day on Tuesday.</p>

                                    <p><strong>YANG: </strong>One of them, SmartDraw from San Diego, will host us all that evening for a private reception at a luxurious downtown setting. Details as soon as we&rsquo;re allowed to talk about it.</p>

                                    <p>All of the components that have made our conference famous will be in place: The ever-accommodating Help Center, for free, drop-in technical support; the flexible scheduling that allows you to pick and choose seminars as you go; the delicious meals; and perhaps above all, the friendly, almost intimate feel that we create for the presentation community to facilitate true relationship-building and bonding &mdash; unmatched at any other business conference you will attend.</p>

                                    <p>We have 26 seats left (we sold one since composing the Subject line) and we would enjoy nothing more than to see you reserve one of them.</p>

                                    <p><a href="http://www.presentationsummit.com/presenters-and-experts">Read the bios for our entire team of experts and presenters</a></p>

                                    <p><a href="http://www.presentationsummit.com/faq">Read our exhaustive FAQ</a></p>

                                    <p><a href="http://www.presentationsummit.com/faq/convince-the-boss">Get advice on how to sell it to your boss</a></p>

                                    <p><a href="http://www.presentationsummit.com/video">See some of our presenters in action</a></p>

                                    <p>Spend three days with us and you will never look at a presentation project the same way again. Three days and you will distinguish yourself from 99% of the people creating and delivering presentations today. Three days that could change your presentation life.</p>

                                    <p> </p>

                                    <p>Rick Altman<br>

                                    Conference Host<br>

                                    The Presentation Summit<br>

                                    Oct 17-20 &bull; San Diego CA<br>

                                    <a href="http://www.PresentationSummit.com">http://www.PresentationSummit.com</a><br>

                                    925.398.6210</p>

                                    <p><img src="http://www.betterppt.com/media/spacer.gif" width="1" height="1" /></p>

                                    <p> </p></td>

                                    <td valign="top"><p><img src="http://www.betterppt.com/email/summit10-07.jpg" width="175" height="156" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-08.jpg" width="175" height="157" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-09.jpg" width="175" height="84" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-10.jpg" width="175" height="124" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-11.jpg" width="175" height="110" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-12.jpg" width="175" height="131" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-14.jpg" width="175" height="116" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-15.jpg" width="175" height="141" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-16.jpg" width="175" height="117" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-17.jpg" width="175" height="146" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-19.jpg" width="175" height="122" style="border-bottom: 2px solid white"><br>

                                    <img src="http://www.betterppt.com/email/summit10-18.jpg" width="175" height="131" style="border-bottom: 2px solid white"><br>

                                    <br>

                                    </p></td>

                                    </tr>

                                    </table>

                                    <p> </p>

                                     

                                    1 2 Previous Next