Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

What's wrong with this script?

Contributor ,
Nov 18, 2011 Nov 18, 2011

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?

396
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 18, 2011 Nov 18, 2011

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

Translate
LEGEND ,
Nov 18, 2011 Nov 18, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp