8 Replies Latest reply on May 12, 2010 3:52 AM by EileenPalsson

    Tools > Scripts > Word Count is broken; can I fix it?

    Bruce4800

      RH HTML; 8.0.2.208

      The script at "Tools > Scripts > Word Count" says "Bad Argument GetTokenManager" and fails.

      It broke while I had 8.0.1, or maybe while I had 8.0.0.

      Can I fix this?

        • 1. Re: Tools > Scripts > Word Count is broken; can I fix it?
          RoboColum(n) Level 5

          You could try looking for the "word count.jsx" file on your install CD which should get you back to the 8.0.0 version. If that doesn't work, let me know and I'll see if I can email you my version.

           

           


          • Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
          • Follow the RoboColum(n) on Twitter
          • 2. Re: Tools > Scripts > Word Count is broken; can I fix it?
            Praful_Jain Level 3

            Hi,

            Did you try running the script with a new project, just create a new dummy project and try running the word count script and see if it works or not.

             

            Also can you let me know what all message are shown in the output view, as this script write log in the output view in RoboHelp 8. To view output view, Select View > Pods > Output View.

             

            Thanks

            Praful

            • 3. Re: Tools > Scripts > Word Count is broken; can I fix it?
              Bruce4800 Level 1

              That was a good idea.

              YES, I can count the words in an experimental project, but NO, I still can't count the words in my real project. The error message is simply "bad argument GetTokenManager". So maybe I can fix something in the project files rather than in the app itself?

              • 4. Re: Tools > Scripts > Word Count is broken; can I fix it?
                Bruce4800 Level 1

                You asked about contents of the Output View, so here it is:

                 

                Started counting word for the project.............
                ****************Started Traversing Topics now*********************
                Started counting word for the project.............
                ****************Started Traversing Topics now*********************

                • 5. Re: Tools > Scripts > Word Count is broken; can I fix it?
                  Praful_Jain Level 3

                  HI,

                  if the script is working for a dummy project, it means the script is working fine, and there is some issue when we run this script in your project.

                  Please open script pod and right click on the word count.jsx file and select edit option. this will open the word count script in Extendscript editor (or notepad).

                   

                  Search for the following line in the script file var tknmgr = RoboHelp.getTokenManager (filepath);

                  and add the following statement before this line.  msg(filepath);

                   

                  so the new code looks like

                  msg(filepath);
                  var tknmgr = RoboHelp.getTokenManager (filepath);

                   

                  Now save this file and again run the script file from RoboHelp 8 by right click and run.

                  this will show the messages in the output view, as to which topic it is trying to open using the token manager and we can get to know where the script is breaking.

                  it will print the file path of the topic which is causing the problem, Please see if you can open that topic from project manager in your Project or not.

                   

                   

                  Do let me know the log in the output view, after you have modified the script file and run it again.

                   

                  -Praful

                  1 person found this helpful
                  • 6. Re: Tools > Scripts > Word Count is broken; can I fix it?
                    Bruce4800 Level 1

                    I followed your suggestion using the Script Explorer.

                     

                    (A problem was that the Script Explorer did not save to the same directory where the "live" Word Count.jsx resides!!

                    When I saved the script to the place where Windows File Search had found it, I was able to run the script with the special diagnostic message.)

                     

                    The addition of msg(filepath); to the script did reveal the name of an "offending" file.

                    It is a file that DOES NOT EXIST in my project folder, but which USED to exist!

                    Apparently, the non-existent file name was coming from the .cpd database, so I deleted the project's .cpd and re-opened the project so that .cpd would be regenerated.

                    That did NOT fix the problem.

                    Now I see that the Project Manager continues to list a lot of files as missing (indicated by a "X" in the Project Manager, even though those files do NOT exist in the project folder.)

                    In other words, the .cpd does not regenerate correctly, and even though I have RH 8.0.2.208, I fear this is a remnant of the Project Manager bug that Adobe worked so hard to fix.

                    What do you think is going on?

                    Thanks.

                    -Bruce

                    • 7. Re: Tools > Scripts > Word Count is broken; can I fix it?
                      Praful_Jain Level 3

                      Hi,

                      Regarding the word count script file, I modified the script file a bit, so that the script file does not stop in case the file is missing or corrupt.

                      I am attaching the new Word Count Script file, which does the check for file presence as well.

                       

                      -Praful

                      • 8. Re: Tools > Scripts > Word Count is broken; can I fix it?
                        EileenPalsson Level 1

                        Thank you for the above postings, which were useful when I got the same error message when running the PopupPlacementFixer script. By adding the msg(filepath); line to the other script, I was able to find the file that was missing from the project -- the last one listed in the Output window was the missing one. Thanks!

                        Eileen