Skip to main content
PuritySyrup
Inspiring
April 3, 2023
Question

Output to a plain ASCII text file from RH 2022

  • April 3, 2023
  • 4 replies
  • 677 views

It seems as though this should be the simplest thing possible. However, I beg you not to outline any procedure unless you have tried and tested it for yourself and can confirm that it actually works.

 

For example, I can confirm that this does not work:

  1. Select the Output tab.
  2. In the Output Presets tab, select the + symbol.
  3. From the Type drop-down list, select Microhelp, then name the preset.
  4. If necessary, select the General tab.
  5. In the Format drop-down list, select Text.
  6. Select the Publish tab, then select or create a profile name.

 

So, if that doesn't work to create a plain ASCII text file -- and it does not -- then what does?

    This topic has been closed for replies.

    4 replies

    Community Expert
    April 5, 2023

    If you know scripting, RH New UI has scripting built in. There's no documentation beyond an extremely basic pdf of some RH specific functions/properties (and last time I looked 2 versions out of date). But the scripts can use react, electron, fs, cheerio, lodash and who knows what the other common scripting libraries (I've seen samples with all the libraries I named). So maybe you can figure out something with the built in RH scripting functions and standard js libraries?

     

    The scripting guide should be in the appendix of the RH help. 

    PuritySyrup
    Inspiring
    April 6, 2023

    The Appendix of the RH help gives me a 404 error. Does anyone have a working link?

     

    https://helpx.adobe.com/ca/content/dam/help/en/pdf/RoboHelp-Scripting-Reference-2019.pdf

    Community Expert
    April 6, 2023

    Try going to the US site (or clicking X instead of selecting a region - this is what I do for every page, as annoying as it is). If you can't get the option, you could try deleting your cookies to try to get the prompt to show. Or, it might be enough to delete the ca from the URL, or delete that part of the path completely.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    April 5, 2023

    Or you use any number of methods discussed on StackOverflow to convert HTML to ASCII text.
    Just curious - what sort of use case do you have that would require plain text to be used? I've never heard of any requirement before for this sort of output in RH.

    PuritySyrup
    Inspiring
    April 5, 2023

    I had already tried converting from HTML to ASCII text and could not find a good one if the short time I had to investigate. (As you noted, there are a lot of choices!) If you have one you recommend particularly, I'm all ears. The ones I tried were a bit... rudimentary.

     

    As for my use case, it's a README.txt to accompany a Python script, and the README varies a lot depending on the user. For example, I have one version for the people who work with me in the same office, another version for the people who work for the same company in other geographic locations, yet another version for the general public... you get the idea.

     

    The script has to remain agnostic about operating system (absolutely anything that runs Python, not just macOS and Windows and Linux). Since most people have their operating system set up (usually by default or by a system admin) to allow them to double-click on a .txt file and have it open it a text editor, I'm trying to create a file that does not require a tool that the user might not have: Microsoft Word, a web browser (yes, really), and so on.

     

    Did that answer your question?

    Jeff_Coatsworth
    Community Expert
    Community Expert
    April 5, 2023

    Sorry, no recommendations - never had to programatically convert HTML to text - I usually just copy/paste via Notepad when I need to.

    I've never heard of RH being used to create README docs - my guess is that 99% of them are just fashioned in a text editor like Notepad++ or in whatever editor the developer is authoring in.

    Community Expert
    April 5, 2023

    I don't believe there's any way to do this in Robohelp these days. (I have vague memories that maybe it was possible to generate a single page xhtml ~ Adobe RH8 or earlier, but I could also be dreaming this - it was a very long time ago 🙂 )

     

    One way that you could get most of what you want is to generate to Word then Save As *.txt from there. That strips out images, and in my very simple test, changed bullets and numbers to asterisks and plain text numbers.

     

    There are two scripting options I can think of as well, but I don't have the skills to test those so won't mention them further.

     

    PuritySyrup
    Inspiring
    April 5, 2023

    Thanks, Amebr! It's a huge time-saver to know that I've been trying to cut away thicket that leads to a dead end.

     

    Your suggestion of creating Word, and using that to create ASCII text is probably the way to go. It's an extra step (not ideal with multiple conditions) but it sure seems like the shortest path from here to there!

     

    If I find any refinements, I'll pop back here to post them for the next person trying to achieve the same thing.

    PuritySyrup
    Inspiring
    April 5, 2023

    While we're on the topic of text, I cannot figure out what the Microcontent "Text" format is for, since it doesn't produce text.

     

    Alternately, if "Text" does produce text (unencumbered by hypertext tags), could someone detail the precise steps, because I cannot make it work.

     

    Format
    
    Specify the desired format for your Microcontent.
    
    *  HTML5 + CSS3 - Use to generate output in markup language with styling (for example, controlling the size of text, font type, background color, etc.).
    *  HTML5 - Use to generate output in markup language without styling.
    *  JSON - Use to generate output in JSON format.
    *  XML - Use to generate output in XML format.
    *  Text - Use to generate output in text format.

     

    Community Expert
    April 4, 2023

    As far as I'm aware, all the files generated are all ascii text documents: .json, .txt and .htm are all plain text documents that can be viewed and edited in, say Notepad. (Although perhaps images are also included, I haven't tested that, I admit.)

     

    Given the output doesn't meet your needs, I think we need more information about what specifically you are trying to achieve.

     

    To start with, what exactly are you looking for? A single txt file that contains all the topic content, without any supporting images, css or html?

     

     

    PuritySyrup
    Inspiring
    April 5, 2023

    Amebr,

     

    Yes, I could have phrased that better! Thanks for the questions.

     

    What I need to create is a single text file that contains all the topic content as ASCII characters inside the "printable set," but no images and no hypertext tags (or elements) of any kind, including XML, XHTML, or HTML, and including CSS. I even want to avoid Markdown, which technically involves only printable ASCII characters.

     

    Back in the 1980s, simple text files were everywhere, and that's what I'm trying to emulate. Or if you prefer an even older analogy, I'm trying to emulate a "man page." If you are on a Windows computer and open the Command Prompt (on most recent versions, hold down the Windows key and R at the same time, then type "cmd"), then type "help" you will see a primitive man page.

     

    I'm using RoboHelp's <p> and <ul>, <ol>, and <li> elements, but I have deliberately set up all the unordered lists to avoid a bullet character (not printable ASCII) but rather a hyphen character. I would love it if I could get RoboHelp to handle the indenting of the list items, but I can live without it.

     

    In theory, I could just create all these files in a simple text editor. But I need RoboHelp's conditional text, variables, and snippets.