Skip to main content
Participating Frequently
Mar 6, 2025 8:06 PM UTC
Question

Indesign 20.2 app.doscript error

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?

 

19 replies

m1b
Community Expert
Community Expert
Mar 10, 2025 11:40 AM UTC

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

Translate
Madhawk65Author
Participating Frequently
Mar 10, 2025 8:54 PM UTC

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.

 

if (typeof JSXSSL !== "object") {
JSXSSL = {}
};

(function() {
if (typeof JSXSSL.crc32 !== "function") {
JSXSSL.crc32 = function(inputFile) {
var argv = inputFile.fullName.replace(/ /g, "\\\\ ");
var aplScript = "do shell script \"crc32 " + argv + "\"";
return app.doScript(aplScript, ScriptLanguage.applescriptLanguage);
}
}
}());

alert(JSXSSL.crc32(File.openDialog("Choose file", null, false)));
Translate
m1b
Community Expert
Community Expert
Mar 10, 2025 10:39 PM UTC

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

Translate
Robert at ID-Tasker
Legend
Mar 6, 2025 8:59 PM UTC

Can you run script called by doScript() alone / directly? 

 

Translate
Madhawk65Author
Participating Frequently
Mar 6, 2025 9:12 PM UTC

Yes. Applescript code just executes simple MacOS terminal commands.

The same jsx code runs smoothly downgrading to ID 20.1

Translate
Robert at ID-Tasker
Legend
Mar 6, 2025 9:27 PM UTC

But what exactly is executed? 

 

Translate