Indesign 20.2 app.doscript error
Copy link to clipboard
Copied
Updated to 20.2 from 20.1
Jsx scripts (good old extendscript) that call Applescripts via app.doScript crash with error -2753.
Anyone experiencing the same issue?
Copy link to clipboard
Copied
Can you run script called by doScript() alone / directly?
Copy link to clipboard
Copied
Yes. Applescript code just executes simple MacOS terminal commands.
The same jsx code runs smoothly downgrading to ID 20.1
Copy link to clipboard
Copied
But what exactly is executed?
Copy link to clipboard
Copied
This is one example:
Copy link to clipboard
Copied
First line was:
Copy link to clipboard
Copied
2753 means that some variable isn't defined?
Copy link to clipboard
Copied
I really don't know. Tried to search js errorcodes, but found nothing about -2375.
Copy link to clipboard
Copied
2753... It's been a loooong day.
Copy link to clipboard
Copied
But it's rather an AppleScript error code - not JavaScript?
Copy link to clipboard
Copied
Yup. If Applescript execution actually starts, that's an undefined var error.
Strange that with ID 20.1 the same veriable is defined.
Maybe I've missed some change in ID 20.2... Or the change is undocumented, or it's an ID bug.
Copy link to clipboard
Copied
Have you test that the shell script works in terminal with dummy inputData, which I assume is the only thing applicable to inDesign?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This runs in ID 20.1 and crashes in ID 20.2
Copy link to clipboard
Copied
I've simplified your example to this:
(function () {
var test = function () {
var aplScript = "display dialog item 1 of arguments";
return app.doScript(aplScript, ScriptLanguage.APPLESCRIPT_LANGUAGE, ['Hello']);
}
alert(test());
}());
This throws the error on my machine ID 20.2. Feel free to test on 20.1 if you get the chance.
- Mark
Copy link to clipboard
Copied
Hi @Madhawk65, did you solve this one? I just wanted to confirm that the problem isn't general for Applescripts run via app.doScript. I can run old script's that call Applescript and they still work normally.
Robert asked you, but you didn't answer I wasn't sure you were answering this specific question: Can you run the Applescript code—the exact Applescript generated by your script—from Script Editor? That would be the place to do the debugging first.
- Mark
Copy link to clipboard
Copied
Hi m1b,
the same jsx runs with ID 20.1, but crashes with ID 20.2.
It is quite obvious that my Applescript code is correct.
It seems like something changed in the way arguments are passed to the Applescript.
Error 2753 is an Applescript error and refers to the fact that no argument is defined.
I solved this one by simply not using the third argument of doScript.
Copy link to clipboard
Copied
Thanks @Madhawk65 that is interesting.
Actually I've always found the arguments parameter of app.doScript a bit flaky and I never use it—I just wrap it all up in a function like you did. From memory I thought the arguments parameter for doScript required an Array though but your code gives a String, so I might not be right there.
If you had time and inclination, you could pare that example down to remove any unnecessary parts—or have you already done so? For example does the problem only occur with "do shell script" AppleScript or with any Applescript if called with a certain nesting/scope structure? I think only then would we have a chance to write a bug report.
Otherwise I would follow your approach of just avoiding the "arguments" parameter of app.doScript altogether.
- Mark
Copy link to clipboard
Copied
I'm told this is fixed in the next release of InDesign, 20.3.

