8 Replies Latest reply on Jan 18, 2011 12:51 PM by City Sue

    ePubGenerator instructuons yield another error

    City Sue

      In RH8, I am trying an epub output for the first time. I find that the instructions by Ankur Janin assume that all readers will be geeks and understand the nuances that are not explained. http://blogs.adobe.com/techcomm/2010/04/robohelp_script_to_generate_epub_format_content_fo r_mobile_d.html

       

      First I downloaded the ePubGenerator script. It was called ePubGenerator_jsx.mht. Why is this? since the RH script explorer would not import it I changed the name to ePubGenerator.jsx. (just a guess - this should be a step in the instructions Ankur).

       

      Then I downloaded and unzipped 7za.exe. Where was I supposed to put this? Does that matter? Is the example path given in Step 4 the correct format? (I understand the \\ are wrong and should be a single \).

       

      I bumbled through and was able to edit the script (so assumed it was the correct file extension) BUT when I tried to run it (I assume, from the Script Explorer), I get a warning "Expected }" and that's it - end of story. I thought I could see where it is missing but no luck.

       

      this is from the script:

      var project; var strProjectName =3D ""; // -- modify the path as per the =
      location=20
      of 7zip on your local machine -- // var str7zipLocation =3D=20
      "C:\Program _Files\Adobe\Adobe RoboHelp8\RoboHelp\7za.exe"; if(RoboHelp =3D=3D null) =
      alert("Please=20
      launch RoboHelp HTML"); else { project =3D RoboHelp.getCurrentProject(); =

       

      Should there be something after the = sign? should there be a closing } to pair the opening one on the last line?

       

      My confidence in ePub has plummeted.

        • 1. Re: ePubGenerator instructuons yield another error
          Jeff_Coatsworth Adobe Community Professional & MVP

          Don't take it out on ePUB - this is a case of RH not being really ready to produce ePUB format help output. The 7z program is a type of zip file creator like WinZip that ePUB docs use in their creation. It should get installed in some c:\program files\ location other than your Adobe RoboHelp folder. Then you edit the javascript to let RH know where the 7z program is located.

           

          If this is too much hassle, you may want to get the new RH9 - it supposedly has ePUB as a SSL option.

          1 person found this helpful
          • 2. Re: ePubGenerator instructuons yield another error
            City Sue Level 1

            thanks for explaining about the 7z and where it needs to reside! Important information. Perhaps a wrong location was the reason for my error. I will test this out and let you know if it resolves the issue.

            • 3. Re: ePubGenerator instructuons yield another error
              City Sue Level 1

              Jeff, I tried placing the 7za exe in another location, but I am still getting the RoboHelp HTML error saying, rather cryptically: Expected:}

               

              I have no clue where, this } would be missing in the script file. do you think it has anything to do with the fact that I change the script file name from ePubGenerator._jsx.mht (as it downloaded) to ePubGenerator.jsx.

               

              If not, I guess I will have to recommend that we upgrade to RH9.

               

              thanks,

              • 5. Re: ePubGenerator instructuons yield another error
                Jeff_Coatsworth Adobe Community Professional & MVP

                Yes, it sounds like you are missing something in the script. Try opening it up through RH > Tools > Scripts > New Scripts. On my TCS2.5 install it launches the ExtendScript Toolkit CS5 so you can have a look at the syntax.

                • 6. Re: ePubGenerator instructuons yield another error
                  A25CharacterScreenName

                  City Sue wrote:

                  First I downloaded the ePubGenerator script. It was called ePubGenerator_jsx.

                  mht. Why is this? since the RH script explorer would not import it I changed the name to

                  ePubGenerator.jsx. (just a guess - this should be a step in the instructions Ankur).

                   

                  This may or may not be a part of the problem. Many years ago Microsoft more or less invented the "Web Archive" file, which is a collection of one or more HTML (and other) files collected into a single file in MIME format; they applied the ".mht" extension to this file.

                   

                  Apparently, you downloaded this file using Internet Explorer (which, AFAIK, is the only browser that creates this format), and selected "Web Archive" as the "Save As" file type.

                   

                  IIRC, a "Web Archive" which consists of a single file is nothing more than the file itself, but my recollection is fuzzy on that. If you want to eliminate the possiblity, download the script again, but tell IE to save it as a text file--then you really can remove the extra ".txt" extension and be sure you have the unaltered script file.

                  Then I downloaded and unzipped 7za.exe. Where was I supposed to put this? Does that matter? Is the example path given in Step 4 the correct format? (I understand the \\ are wrong and should be a single \).

                   

                  7za.exe is simply a .zip file manager (and a pretty good one at that). As others have explained, just put it wherever you put your collection of other utility programs. The script simply needs to know where to run it from.

                   

                  The double back slashes are, in fact, not wrong. What 'var str7zipLocation="C:\\etc.' is doing is creating a string variable. Inside literal strings the back slash is an escape character which is used to encode characters that would otherwise be invisible. Because of this, if really want to use a back slash as a back slash, and not a way to encode the following character, you must use two slashes. It should also work if you replaced each double back slash with a single forward slash, e.g. "C:/Program Files/7-Zip/7za.exe"; M$Windows accepts either one.

                   

                  This may be the cause of your problem, as \r is the code for a carriage return (start a new line) and \[d] (where [d] is a digit) signals the beginning of an octal representation of a character; one of these problems might be causing a syntax error in the script.

                  I bumbled through and was able to edit the script (so assumed it was the correct file extension) BUT when I tried to run it (I assume, from the Script Explorer), I get a warning "Expected }" and that's it - end of story. I thought I could see where it is missing but no luck.

                  All curly braces in Javascript must be balanced. The message you are getting seems to be saying that the script engine encountered an opening brace but not a closing one; an indication that your file is corrupted or incomplete.

                   

                  [snip]

                   

                  Should there be something after the = sign? should there be a closing } to pair the opening one on the last line?

                   

                  Yes, and yes. The script file I downloaded is 551 lines long, and ends with:

                          if(deleteRootFolder == true) folder.remove();
                          if(listOfFiles != null) delete listOfFiles;
                      }
                  }

                  If this does not match your file, then you probably have a bad download. Start by downloading the script again, as I suggested above. Open it in any text editor and make sure it matches the clues above (551 lines, ending as indicated). Do not make any changes to it, and import it into the Script Explorer pod. Run it as is; you should see a dialog appear asking where to place the output file, then one or more error dialogs, perhaps suggesting that you haven't generated XML output (an undocumented prerequisite) or that it cannot execute 7Za.

                   

                  You will now know that the script is good. Now edit the script to point to your 7Za location and try again (the script really should allow you to browse for it, but this is, after all, a first attempt). The script still may not behave correctly, but at least you can move forward in resolving your site-specific problems.

                  My confidence in ePub has plummeted.

                  As others have suggested, don't blame the format (which was developed by a group independent of Adobe) for what may be a flawed attempt to generate it. And I would strongly suggest you don't use Adobe Digital Editions to view the resulting .epub when you finally get one; Calibre (http://calibre-ebook.com/) is probably the tool you will want to use with .epub files.

                  • 7. Re: ePubGenerator instructuons yield another error
                    Captiv8r Adobe Community Professional & MVP

                    Hi Lee

                     

                    A25CharacterScreenName wrote:

                     

                    ...And I would strongly suggest you don't use Adobe Digital Editions to view the resulting .epub when you finally get one; Calibre (http://calibre-ebook.com/) is probably the tool you will want to use with .epub files.

                     

                    Can you please enlighten us on what your reasons are for suggesting that folks avoid using Adobe Digital Editions?

                     

                    Thanks... Rick

                     

                    Helpful and Handy Links

                    RoboHelp Wish Form/Bug Reporting Form

                    Begin learning RoboHelp HTML 7, 8 or 9 within the day!

                    Adobe Certified RoboHelp HTML Training

                    SorcerStone Blog

                    RoboHelp eBooks

                    • 8. Re: ePubGenerator instructuons yield another error
                      City Sue Level 1

                      Thanks to Jeff and Rick for your responses. I was able to run the script, and am at the point of trying to read the output.

                       

                      Impressed by you taking the time to make a video for me Rock - that is indeed service!.

                       

                      But, I have just been laid off along with lots of other beople, so will try and follow the steps in your video for my own curiosity only.  Then I will be looking for a new job!!