You can use RoboHelp's scripting feature to achieve this.
Below is a simple script that should solve the purpose. Save this script in a text file with extension .jsx (e.g. UpdateFM.jsx)
Place the script file at the appropirate location and call this script from command line before making a call to RHCL.exe. This can be done by typing the following command from command line
RoboHTML.exe -x UpdateFM.jsx
In case you face any issue, I can send you the script file.
Another way can be to not to use RHCL.exe at all. RoboHelp scripting is powerful enough to take care of SSL generation as well. The script can be modified to achieve this. In that case calling just the script should suffice.
Please let me know in case any further elboration is required.
Can you direct me to the RoboHelp ExtendScript reference docs?
You can view the Object Model of scripting from ExtendScript Tookit.
1. In ExtendScript Tookit goto Help -> Object Model Viewer menu
2. Viewer will launch. Select "Adobe RoboHelp 8 Object Library" from the Browser drop down on the top left of the viewer
You can also refer the sample scripts installed with RoboHelp8
Thank you for your help Mayank.
My new problem is that the linked files are done by absolute path rather than relative path so the linked files are 'broken' in the .xpj when they are copied to the build box as they are copied to a different folder path then on my machine.
I tried to create a script that would open the .xpj and import the individual .fm files but that is failing. RoboHelp opens, my project is loaded, FrameMaker opens, yet no new files are in my RoboHelp.
For now I will stick with a manual generate from RoboHelp and commit the output pre-build rather than full automation/CI.
Thanks Mayank for your help, I've learned quite a bit from this.
Inorder to solve your absolute path problem, you can try "Create a Copy and Link" option. This option creates a copy of the original source FM document. This copy is placed in the RH project folder and the copy is linked. RH keeps a relative path of the link. This option can be set in the "Import" tab of "Project Settings" dialog.
Besides this, if you want to go with scipt you were trying to write, you can share the script with me at my email id magrawalATadobeDOTcom
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?