Javascript error number 8 : syntax error using Pagestaker script
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.");
}
Copy link to clipboard
Copied
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:
Copy link to clipboard
Copied
Yeh not great
See the post I put below - you might need a different APID tool for your new system
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Ah ok I did not understand this, you mean the .bin file? Encoded meaning only the original dev can read it?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
What is wrong with this site?
The previous message:
has been posted 8 HOURS ago - but notification has been generated few minutes ago.
And it's not the first time...
Copy link to clipboard
Copied
It will be very hard to investigate as PageStakerLib.jsxbin is a JSXBIN...
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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

