Skip to main content
Participating Frequently
May 28, 2024
Question

Javascript error number 8 : syntax error using Pagestaker script

  • May 28, 2024
  • 3 replies
  • 1211 views

Windows 10 / Indesign 19.0.1

I just had to reinstall my system on a new harddrive. Copied all my scripts to the new installation from the old system drive but when I try to run the Pagestaker script I get an error:

 

Error number 8 / Syntax error

in line 25 :

app.doScript(libPath, ScriptLanguage.JAVASCRIPT);

 

Here's the entire script in case there's something else:

app.insertLabel('com.rorohiko.activescriptpath', '');
var scriptFile;
if ($.fileName && $.fileName != "")
{
    scriptFile = new File($.fileName);
}

if (! scriptFile || ! scriptFile.exists)
{
    if (app.activeScript instanceof File)
    {
        scriptFile = app.activeScript;
    }
}

if (scriptFile)
{
    var libPath = new File(scriptFile.parent + "/PageStakerLib.jsxbin");
    if (! libPath.exists) 
    {
        libPath = new File(scriptFile.parent + "/PageStakerLib.jsx");
    }
    if (libPath.exists)
    {
        app.doScript(libPath, ScriptLanguage.JAVASCRIPT);
        PageStakerLib.processCurDoc();
    }
}

 

I don't know anything about javascript and I didn't modify this script at all, any help will be greatly appreciated.

 

This topic has been closed for replies.

3 replies

aklbeAuthor
Participating Frequently
May 29, 2024

In case anyone else is having this problem, I have regressed to InDesign v 17 / 2022 and the script works there as before. Apparently not compatible with the latest version of InDesign.

 

Adobe team, PLEASE integrate page numbering for epub export directly into InDesign so we don't have to rely on third-party scripts which may or may not be compatible with updates.

Community Expert
May 29, 2024

That's the compatibility with the script you need to contact the developer. I can't find that script myself so not sure.

 

If it works there then great.

 

For what you request best place is 

Report bugs or make a feature request

https://www.adobe.com/products/wishform.html

 

Robert at ID-Tasker
Legend
May 29, 2024

It will be very hard to investigate as PageStakerLib.jsxbin is a JSXBIN...

 

Community Expert
May 29, 2024

Good point

 

Just checking out Rorohiko site and it says you have to download an APID Tool 
https://www.rorohiko.com/wordpress/indesign-downloads/framereporter/

 

Seems there's plenty of configurations - maybe your previous is no longer compatibel and you need to install a compatible APID Tool?

 

Maybe check the developer for a fix?

aklbeAuthor
Participating Frequently
May 29, 2024

APID is normally not necessary for this particular script. Just in case I did install the latest version from the developper's site; no change.

 

I will try to contact the developper also.

Community Expert
May 29, 2024

I added some alerts to see where it's failing 

 

app.insertLabel('com.rorohiko.activescriptpath', '');
var scriptFile;
if ($.fileName && $.fileName != "") {
    scriptFile = new File($.fileName);
}

if (!scriptFile || !scriptFile.exists) {
    if (app.activeScript instanceof File) {
        scriptFile = app.activeScript;
    }
}

if (scriptFile) {
    var libPath = new File(scriptFile.parent + "/PageStakerLib.jsxbin");
    if (!libPath.exists) {
        libPath = new File(scriptFile.parent + "/PageStakerLib.jsx");
    }

    if (libPath.exists) {
        try {
            app.doScript(libPath, ScriptLanguage.JAVASCRIPT);
            PageStakerLib.processCurDoc();
        } catch (e) {
            alert("Error executing script: " + e.message);
        }
    } else {
        alert("Library file does not exist: " + libPath.fsName);
    }
} else {
    alert("Script file is not defined or does not exist.");
}
aklbeAuthor
Participating Frequently
May 29, 2024

Thank you @Eugene Tyson . I changed the script to use your version, instead of the regular Adobe error box with some details I just got a simple error message:

Community Expert
May 29, 2024

Yeh not great

 

See the post I put below - you might need a different APID tool for your new system