I'm attempting to use the attached script, but I get this error message: "Bad argument openProject". I found this thread: http://forums.adobe.com/thread/561384 but I am not running Windows 7, so I don't think the solution proffered there applies to my situation.
Any suggestions very welcome!
Thanks in advance!
you need to update the variable in the script "projectPath" before you run it for any project,
for example if you project .xpj path is "C:\Users\Ashish\Documents\My RoboHelp Projects\RH8_1\RH8_1.xpj" then you have to update "projectPath = C:\\Users\\Ashish\\Documents\\My RoboHelp Projects\\RH8_1\\RH8_1.xpj" in your script and then run it.
The error shows that the path defined in the variable is incorrect.
Hope this will help
Thanks, Ashish. I updated the project path per your suggestion, but now I get an error that says "Robohelp undefined". Is the syntax incorrect maybe? Here's what I have:
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.
if(projectPath = '')
//Error!. Quit RoboHelp
alert("Project path is not defined. \nPlease update the 'projectPath' variable in the script.");
RoboHelp.openProject(projectPath); //Open the project
RoboHelp.project.updateAll(false); //Update all linked documents (pass true for Force update)
RoboHelp.quit(); //Quit RoboHelp
now a question arises how are you running this script.
there are two methods to run a RoboHelp's Extendscript
1. From within RoboHelp
a. Launch RoboHelp
b. Open script pod and Import the script to run in it
c. Right click on the script and select run.
2. From command line
you need to use the RoboHelp engine to run a script directly from the command line the call will look like as shown below
"D:\Program Files\Adobe\Adobe RoboHelp 10\RoboHTML\RoboHTML.exe" -x C:\Automation\scripts\FMLinkAndUpdate.jsx
which is <RoboHelp's exe path> -x <script path>
The error shows that it is not run through RoboHelp engine.
Hope this will help
Thanks, Ashish, running the script from within RoboHelp as you described did work. However, running it via the command line returns the "Bad argument openProject" error. Any idea why that might be happening?