Copy link to clipboard
Copied
This opens a project in RoboHTML:
var projectPath = "C:\\scratch\\test\\test.xpj";
main();
function main()
{
RoboHelp.openProject(projectPath);
}
This opens RoboHTML but not the project:
var projectPath = "C:\\scratch\\test\\test.xpj";
main();
function main()
{
if(projectPath = '')
{
alert("Project path is not defined. \nPlease update the 'projectPath' variable in the script.");
RoboHelp.quit();
}
RoboHelp.openProject(projectPath);
}
What's the error?
Hi,
You're setting the project path to empty with your if statement:
if(projectPath = '')
should be
if(projectPath == "")
With a single =, you set the value of a variable. With double ==, you check whether the variable has the same value as the variable/string/etc.
Greet,
Willam
Copy link to clipboard
Copied
Hi,
You're setting the project path to empty with your if statement:
if(projectPath = '')
should be
if(projectPath == "")
With a single =, you set the value of a variable. With double ==, you check whether the variable has the same value as the variable/string/etc.
Greet,
Willam