Saving text generated by script as an html file

Hi
I have designed a script that generates text which I would like to save as an html file called 'index.html' on my desktop. Is it possible to do this using TextEdit or some other application?
Thanks
Nick

You don't need to use an app to accomplish this. The following will take the contents of a variable myHTML, create a file test.html, write to it, and close it.
If you are generating the HTML in a loop, you can write to the file as it's generated or - as here - put it all into a single variable and write in one go.
You'll probably want to specify a complete path for the file!
set myHTML to "some html"
set theFile to open for access file "test.html" with write permission
set eof theFile to 0 --empties file if it contains anything
write myHTML to theFile
close access theFile

Similar Messages

  • Saving textpane wrapped in htmleditorkit to an html file

    Hey,
    Do any of you people know what I am doing wrong with the following code? It will not take the typed text, convert it to html code, and save it as an html file. The file saves properly, but it is just blank w/ no text and such.
    please help
              else if (mi == save)
                   JFileChooser chooser = new JFileChooser();
                 int result = chooser.showSaveDialog(this);
                 if (result == JFileChooser.CANCEL_OPTION)
                     return;
                 else
                        try
                             File loadFile = chooser.getSelectedFile();
                             OutputStream out = new FileOutputStream(loadFile);
                             htmlkit.write(out, htmldoc, 0, htmldoc.getLength());
                             out.close();
                        catch (Exception ex)
              }

    Granted this is just a snippet of your code, but while you're talking about 'it' not taking the 'typed' text I had in my mind your keying in text in a JEditorPane or JTextPane. But it seems that you mean 'typed' into the file you're reading in.
    Also, what is htmlkit ... I can't locate any such class in the 1.4.2 API ... am I missing it?
    So, it sounds like you want to take a text file, read it in, then write it out as an html file. Am I right? In that case, if htmlkit is your own class, post the code for it.
    I don't know if you'd want to try this, but it's any easy matter to write text to a JEditorPane or JTextPane with an attached EditorKet and write it out from there with code like this:
    FileWriter fw = new FileWriter( loadFile );
    fw.write( jtp.getText(), 0, jtp.getText().length() ); // jtp is the JTextPane
    fw.close();

  • UCCX 10.X Unable to get Queue Stats to write from a script to an HTML file

    We upgraded from CCX 7.X to CCX 10.5. After the upgrade I am unable to get a Queue stats web page working. I have changed the 'create doc' step to 'set doc' but I cant seem to get it to work. I have uploaded the SYDNEY.html file to the document repository. I have attached the script and web page.
    Any info is appreciated
    Thanks!

    Thanks for the response. There was a unrelated problem with the server and I restarted the engine and it is working now.
    The script works and can be used as a sample.
    The only change I made was I updated the HTML file with the following line so that when the page refreshes it points to the correct URL.
    <meta http-equiv="Refresh" content="5;url=http://10.20.8.51:9080/SYDNEY"/>
    Thanks!
    Craig

  • Having trouble saving text from Arabic-script PDFs

    I have several PDFs created using different versions of the PDF format with text that uses the Arabic script (i.e. Arabic, Farsi, etc.) All I need is to save the text properly into something like a Unicode text file, an RTF or a DOC file, or something similar. I use Adobe Acrobat Std ver 7 and often get error messages or the text that is saved is corrupted. What components/fonts/software/etc do I need to install on my machine to do this properly? While the operation that I need - "Save as ..." - is pretty basic, the variety of PDF documents I have is pretty wide in terms of when and how they were created, what languages they contain etc. Thanks!

    Bil,
    Thanks for the info. I actually did observe exactly that in a couple of cases, i.e. "copy & paste" worked when "save as" did not. Do you know what is fundamentally different between these two operations? Also, if I am willing to lose all formatting and just get pure text (I am thinking of "pure text" as a UTF8 or UTF16 byte stream), does this make my life any easier? Finally, how can I find out which font I have problems with when I "save as" and get garbage? E.g. if I open the PDF file in a text editor, where is the detailed font info?

  • Calling HTML File in Shell Script.

    Hi
    I have a shell script and a HTML file.
    HTML file is to create a Table.
    the HTML Script is as follows
    <html>
    <body>
    <table border="1">
    <tr>
    <td>Requisition Number</td><td>$PARAM0</td>
    </tr>
    <tr>
    <td>Purcahse Order Number</td><td>$PARAM4</td>
    </tr>
    <tr>
    <td>Purchase Line Number</td><td>$PARAM5</td>
    </tr>
    <tr>
    <td>Hold Reason</td><td>$PARAM3</td>
    </tr>
    <tr>
    <td>Hold Date</td><td>$PARAM2</td>
    </tr>
    </table>
    </body>
    </html>
    The output of this HTML file is a table with 5 rows and 2 columns.
    I saved this file as mail.html and placed it in the server where i have placed the Shell Script.
    When i call this HTML in Shell Script ... as follow
    cat /FND_TOP/bin/mail.html
    the output is not the table but infact the html tags are displayed.
    I need the table when i run this shell script.
    It would be of great help if anyone has a good solution for this.
    Thanks in Advance

    First, you need to put the file where your httpd server (you will need apache running) can find it. This is usually some place like:
    /var/www/html/table.htmlThen use a text-mode browser as Frits suggested to render it so your script can read it:
    #!/bin/sh
    lynx -dump http://localhost/table.html | while read row; do
        echo "${row}"
    doneor how ever you want to process the data.
    Another approach is to use XML transformations. First write an XML stylesheet:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="1.0">
         <xsl:output indent="no" method="text" standalone="yes" version="1.0"/>
         <xsl:template match="*">
              <xsl:apply-templates/>
         </xsl:template>
         <xsl:template match="td">
              <xsl:text> </xsl:text>
              <xsl:value-of select="normalize-space()"/>
         </xsl:template>
    </xsl:stylesheet>and then run your HTML through the {font:Courier}xsltproc{font} processor:
    $ xsltproc table.xsl table.html
    Requisition Number $PARAM0
    Purcahse Order Number $PARAM4
    Purchase Line Number $PARAM5
    Hold Reason $PARAM3
    Hold Date $PARAM2To be neat, I have omitted the many blank lines that were also output.
    HTH

  • Combining bookmarks .html files, and sorting

    Hi,
    (1) I know how to import bookmarks, but, once I import all of my bookmark .html files, (have 6)... than I go to show all bookmarks, I have 6 "unsorted bookmarks" folder tabs, and one "unsorted bookmarks" tab of my current bookmarks. How do I combine all of these into 1 giant .html file? Or is it automatically combined once I imported, to where I can export and it'll have all 6 old .html files and my current bookmarks?
    (2) I know how to sort bookmarks, and I like sorting by "location", but is there a way to export as .html file so it saves the .html book mark file by "location"?
    (3) In the .html file there is some sub description for each bookmark, such as "Twitter is a social networking site, where users tweet to other users blah blah", is there any way to delete this? I'd like it only to display the bookmark name and the URL (usually I'll have to click on the name and it'll open up the website), but I like the website to be typed out.

    -1- <br />Yes all those bookmarks.html files will be merged into Firefox, and when you 'export' from Firefox those 6 files will be in one html file. No those extra 'unsorted bookmarks' folders won't be automatically combined, you need to do that yourself.
    -2-<br />No, 'location' sorting isn't reflected in an exported bookmarks.html file. That type of 'sort' is temporary in the Library view, and doesn't rearrange bookmarks in the places.sqlite file which is what is exported in html format. <br />
    Save this code as a Bookmarklet and click on it to make an HTML page editable. <pre><nowiki> javascript:document.body.contentEditable='true';%20document.designMode='on';%20void%200</nowiki></pre>
    Once the page is 'editable', you will be able to cut and paste bookmarks from one place on the page to another.
    -3-<br/>This code when run in the URL bar ''(or saved as a bookmarklet)'' while a bookmarks.html file is being displayed in Firefox will strip the extraneous information from that bookmarks file. Just save the bookmarks file when the 'strip' is completed.
    <pre><nowiki>javascript:%20(function(){%20var%20ls=document.getElementsByTagName('*'),%20lsl=ls.length;%20for%20(var%20i=0;%20i<lsl;%20i++)%20{l=ls[i];%20l.removeAttribute('id');%20l.removeAttribute('last_charset');%20l.removeAttribute('icon');%20l.removeAttribute('ICON_URI');l.removeAttribute('last_modified');%20l.removeAttribute('last_visit');%20l.removeAttribute('add_date');%20l.removeAttribute('personal_toolbar_folder');}%20var%20e=document.getElementsByTagName('dd');%20el=e.length;%20for(var%20i=el-1;i>=0;i--)%20e[i].parentNode.removeChild(e[i]);%20alert('Cleanup%20Complete%20-%20Save%20as%20Web%20Page,%20Complete\n'+'('+lsl+'%20bookmarks,%20'+el+'%20descriptions)')})();</nowiki></pre>
    - brief explanation of Bookmarklets - <br />http://www.bookmarklets.com/ <br />http://en.wikipedia.org/wiki/Bookmarklet

  • How to load an html file in Text Box using script?

    Hi,
    does anyone know what is the sequence of commands for inserting an html file in a text object, if possible, via vbs?
    Unfortunately, I wasn't able to find the Commands and Variables for the text object (aka user object) in the help. Where I can search for them?
    Thank you!

    Hi def90,
    Sorry for the confusion. In that point the help information is not correct. We can only import RTF and ASCII via script but not HTML. We are going to change the help for that.
    Greetings
    Walter

  • By saving for web text-layer becomes a image in HTML what is wrong?

    By saving for web text-layer becomes a image in HTML what is wrong? In this way I can not use CSS in the editor.

    Right click on the layer, Duplicate Layer, set destination to the other image file in the dropdown.

  • Simple Browser which support locally saved html file having Marquee text

    I want simple java browser in which I can run locally saved html file having marquee text in it.
    My requirement is to show html file in Oracle forms.For that i need JAR Files of that browser which support html file(locally saved & support marque text).
    Because i use several browser which support locally html file but not support marque text.These browser display static html file not marque text in it.
    Can anybody help me.
    Regards

    1. There is no reliable way of guessing the encoding of a file without that information. Thats why XML for example has very strict rules wrt. it's encoding (short form: use UTF-8 or UTF-16, if you use anything else, you'll have to specify it)
    2. you might be able to make an educated guess if the possible range of encodings is limited, but it will probably never be 100% certain
    3. The HTML file might have a header entry "<meta http-equiv..." that tells you about it's encoding. You could try to read the start of the file and see if you find that, then if you found it re-read the entire file.
    regards

  • Web browser for running locally saved html file with Marquee Text

    I have a html file contain Marquee text.
    I want to display that html file in oracle forms(10g).
    I already use simple html browser but it does not support marquee text.
    I already tried to convert the html file into Gif file but Marquee text not appear in gif file.
    Is there any browser which support the locally saved html file with marquee text and also it can be embedded in oracle form.
    Or is there any way for display that html file within the oracle forms.
    Remember I don't want to display that file in separate window.I want to display that html file within the form.
    Regards

    Actually that is what I was doing last night and got a bad flash and bricked my router..so its on its way back to Linksys...

  • Saving the source of html file generated using PLSQL into a client folder

    Hi All,
    I have generated html pages using htp procedure calls. On a button click, these html pages need to be stored as html files on a local client drive folder. My requirement says okay with resulting security issues.
    I have a couple of queries.
    1.Any client side javascript can fetch the source of a html file and can be saved as another file in a client drive?
    2.Using PLSQL, i generated the html pages using htp procedure calls. Is there any way to save contents of the output to a specific folder. (using owa_util or utl_http packages or any other means)
    Is there any way that i could do this.. Any help is appreciated.
    Thanks in Advance.

    > 1.Any client side javascript can fetch the source of a html file and can be saved as another file in a client drive?
    No.
    > 2.Using PLSQL, i generated the html pages using htp procedure calls. Is there any way to save contents of the output to a specific folder. (using owa_util or utl_http packages or any other means)
    No, you cannot from PL/SQL simply write to that client's folder - unless a very complex and very insecure and very non-scalable method of dynamically mapping client folders are implemented.
    This whole approach is also extremely insecure. If you can from the server push a page to a folder on a client, you can also push a binary "page" to a client folder - where this "page" is in fact a worm/virus/trojan that you simply write into the StartUp desktop folder to have it autostarted to install itself on that client.
    Also - web browser automatically save the contents from a web server in their local cache. Thus the pages received are automatically saved locally. For the security reasons already mentioned, operating system and web browser treats this cache with suspicion as it could contain cached virus/worms/trojans - so the cache operates under extreme security conditions.
    The correct way to handle this requirement is to state next to the URL for that HTML page that the user wants downloaded to right-click on it and to select the "SAVE URL AS" option to save it to a local folder.
    Saving that page on the client is the client's responsibility and ownership - from security to simply deciding where that file must be placed on the client system.

  • I-text for saving html files using java

    hi,
    i'm writng a small application and it has some report generation part based on some html templates.
    These templates have some images which are given the relative path in the html template files.
    when i generate my reports they generated and save in some other location and the thing is quite naturally all the image files are missing. can anyone help me to overcome this problem??
    thanks in advance.

    If you are using Windows take a look at what Internet explorer does when you save a web page
    If the files is save as MyFile.htm the browser will create a folder called MyFile_Files and store all the images there. and it will modify the code of the html file to refer those images.
    I think that you will have to do the same.
    Or
    Find some API which can convert HTML page in to PDF and save PDF then you will get a one file with everything in it. I think that is a better solution.
    But the way If you found such an API dont foget to post here about it . I have the same problem and I dont like the solution one

  • How to display an HTML file in text Area?

    I am trying to display an HTML formated file in  text area component using Action 3.0. The following script does not generates compiler errors, each function seems to be executed yet the file is not displayed. When trying the same code with myCV.txt and myCV_TA.text = (loader1.data) the text file is displayed OK. Flash MX and actionscript 2.0 had handled that differently but with success???
    ( myCV_TA is the text area component)
    Thanks
    var loader1:URLLoader =new URLLoader();
    loader1.addEventListener(Event.COMPLETE,displayText);
    textload("myCV.html");
    function textload(file:String)
    loader1.load(new URLRequest(file));
    trace("in textload");
    function displayText(e:Event)
    myCV_TA.htmlText = (loader1.data);
    trace("in displaytext");

    hmm.. never tried to use an .html file like that in flash, what's inside that file? text with images tables and so on? the htmltext property supports only a few HTML tags, maybe it's not working because an unsupported tag has been detected.

  • Saving jpeg and html file into different folders

    Hi, all.
    I developed a VI that generates, on a timely basis, reports (HTML format) that contain some text, numerical values and graph images (jpeg). The problem is that when it saves a HTML file to a folder, JPEG files are also saved into the same folder.
    Is there any way I can save these html and jpeg into different folders?
    Or is it even possible to generate html report with some graph images without having to have save jpeg files? (this would be even better).
    I included a screen shot of the VI.
    Thanks in advance for your help.
    Attachments:
    screen shot.doc ‏184 KB

    There is currently no way, with the Report Generation VIs, to save the image files for an HTML report to a separate folder.  If you think this would be a helpful feature, please submit your request to the Product Suggestion Center, and we will look into possibly including this feature in a future release.  For now, the only workaround I can think of would be for you to use the File I/O VIs to manually create another folder and move the image files to it, then use the string manipulation functions to edit the contents of the HTML file to point all image file references to the new location.
    As for not generating images, I don't know of an easy way to have an HTML page with images where there are not corresponding image files.
    Good luck,
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Error while saving text as attachment

    Hi All,
      When a layout is generated. I get the following error :
    Error while saving text as attachment , Size of the attachment is maximun than the size allowed.
    I guess the generated layout is automatically saved as attachment. Can any one suggest how to disable the option of automatic saving as attachment
    Thanks ,
    Kaushik

    Hi,
    if you want to keep the automatic saving as attachment you might check note 599680.
    The saving is done normally in method TextGeneration in the underlying Business Object, e.g. BOSALESDOCGEN, BOACTIVITY or BOSERVICETRANSACTION. There you will find the according code lines in the end.
    Regards,
    Wolfhard

Maybe you are looking for