Hi Colum - and thanks for your help.
The Word Count script runs fine on our template (returning 300 words, or so). We're still getting to grips with RH8 and not sure how to re-install the Extend Script add-on - should we uninstall everything and start from scratch or is there a simple way of just re-installing ES?
No problem Nigel. Did you run the Word Count on the affected PC? If so, this is unlikely to be anything with the ExtendScript plugin. It maybe worth trying though. If you run the setup.exe for the RoboHelp Office application, you should be able topick and choose which elements are installed. One of them should be ExtendScript. Just select this option only on the affected PC.
One other thought I have is that you mention "default location". Would mapped or networked drives have any bearing on the error?
The RoboColum(n) @robocolumn Colum McAndrew
Thanks again Colum.
I've run Setup.exe with the bottom option selected, as advised but to no avail.
Our PCs have a C: drive and a D: drive which are not mapped drives. The template we are attempting to save as the project template is located on the D: drive and the 'default location' the script suggests is the En_US folder on the C: drive.
Dare I mention that the PC that does not work is a Windows 7 PC (I should have mentioned this before), so could it be a weird permissions thing?
The script tries to open a project twice: Once it opens the new template project to rename it to Template. After that, it closes the template project and tries to reopen the original project. When does the error occur?
My best guess is that you have some exotic path name that the script can't parse. You can try adding a few alerts around line 48 to see which projects the script tries to open.
I didn't see your last post when I posted my earlier reply. Using Windows 7 may indeed be a problem. I had a problem with writing files when User Account Control was enabled. This blocked the script from writing files to protected locations as C:\Users and C:\Program Files. It didn't produce any errors, the files were simply not created/modified and the script kept running.
Can you disable UAC for now and run the script again?
Hi Willam... This has worked! Changing the setting to the bottom level, restarting the machine and trying again fixed the problem. Thanks very much to both of you for your help
I've run into the same problem (i.e., getting the Bad argument openProject error) when trying to run the UpdateFM.jsx script provided in this (somewhat related) thread: http://forums.adobe.com/message/203012#203012
But I'm running Windows XP, so the User Access Control problem doesn't apply here (as far as I can tell). Any thoughts on what might be going on?
Also, the script works perfectly when I run it from within RoboHelp (i.e., in the Script Explorer), but I cannot get it to work from the command line.
Thanks in advance for any ideas!
My colleague (Robert Lauriston) just solved it for me: the problem was in the error handling part of the script:
if(projectPath = '')
//Error!. Quit RoboHelp
alert("Project path is not defined. \nPlease update the 'projectPath' variable in the script.");
Once I removed that, the stripped-down version worked just as I had hoped:
var projectPath = "C:\\techpubs\\AG\\SentrionAdminGuide.xpj";
// User should update the project path.
// e.g. "C:\\Users\\mayank\\Documents\\My RoboHelp Projects\\RH8_1\\RH8_1.xpj"
//PLEASE NOTE: Replace '\' with '\\' in the path above.
RoboHelp.openProject(projectPath); //Open the project
RoboHelp.project.updateAll(true); //Update all linked documents (pass true for Force update)