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

Launch batch file from RoboHelp 9 ExtendScript?

Contributor ,
Apr 16, 2012 Apr 16, 2012

Can I launch a batch file at the end of a RoboHelp script?

980
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
Contributor ,
Apr 16, 2012 Apr 16, 2012

Aha, there's an example in C:\Program Files (x86)\Adobe\Adobe RoboHelp 9\RoboHTML\presets\scripts\ePub Generator.jsx:

function OnOpenZipURLInBrowserClick() {

    var tempFolder = Folder.temp;

    var batchFile = new File(tempFolder.fsName + "\\2C19034A-F44E-41af-BF3A-10879747CB24.bat");     //temp file name

    var strCommand = "start http://stahlforce.com/dev/zip.exe \nexit";

    writeToFile(batchFile.fsName, strCommand, false);

    //run this batch file to open the URL in browser

    batchFile.execute();

}

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
Contributor ,
Apr 16, 2012 Apr 16, 2012

That example is so complicated I can't figure out how to adapt it.

Is there some way to execute an existing batch file with a single command, something like "c:\\test\\test.bat".execute()? I can't find any documentation on execute().

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
Contributor ,
Apr 16, 2012 Apr 16, 2012
LATEST

Aha, fileObj.execute() is documented here:

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/scripting/pdfs/javascript_tools...

So how do I specify fileObj is an existing batch file?

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