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

Javascript error number 8 : syntax error using Pagestaker script

New Here ,
May 28, 2024 May 28, 2024

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.

 

TOPICS
Scripting
692
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
Community Expert ,
May 29, 2024 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.");
}
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
New Here ,
May 29, 2024 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:

2024-05-29_15h05_51.pngexpand image

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
Community Expert ,
May 29, 2024 May 29, 2024

Yeh not great

 

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

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
Community Expert ,
May 29, 2024 May 29, 2024

@aklbe

 

As per initial error message - it's on the line that calls external script - that is encoded - and the real error is inside this external script.

 

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
New Here ,
May 29, 2024 May 29, 2024

Ah ok I did not understand this, you mean the .bin file? Encoded meaning only the original dev can read it?

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
New Here ,
May 29, 2024 May 29, 2024

Just in case it's useful here is that file. I can't attach a jsxbin file directly so I just appended .txt to the file name.

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
Community Expert ,
May 29, 2024 May 29, 2024
LATEST

What is wrong with this site? 

 

The previous message:

Screenshot_20240529_222915.jpgexpand image

has been posted 8 HOURS ago - but notification has been generated few minutes ago. 

 

And it's not the first time... 

 

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
Community Expert ,
May 29, 2024 May 29, 2024

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

 

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
Community Expert ,
May 29, 2024 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?

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
New Here ,
May 29, 2024 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.

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
New Here ,
May 29, 2024 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.

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
Community Expert ,
May 29, 2024 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

 

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