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

Indesign 20.2 app.doscript error

Community Beginner ,
Mar 06, 2025 Mar 06, 2025

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?

 

Screenshot 2025-03-06 at 20.40.35.pngexpand image

TOPICS
Bug , Scripting , SDK
557
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 ,
Mar 06, 2025 Mar 06, 2025

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

 

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 Beginner ,
Mar 06, 2025 Mar 06, 2025

Yes. Applescript code just executes simple MacOS terminal commands.

The same jsx code runs smoothly downgrading to ID 20.1

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 ,
Mar 06, 2025 Mar 06, 2025

But what exactly is executed? 

 

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 Beginner ,
Mar 06, 2025 Mar 06, 2025

This is one example:

set inputData to item 1 of arguments\r";
aplScript += "set pass to item 2 of arguments\r";
aplScript += "set shellScript to \"echo \" \r";
aplScript += "set shellScript to shellScript & quoted form of inputData\r";
aplScript += "set shellScript to shellScript & \" | openssl enc -d -a -aes-256-cbc -pass pass:\"\r";
aplScript += "set shellScript to shellScript & pass\r";
aplScript += "set shellScript to shellScript & \" -md sha512\"\r";
aplScript += "do shell script shellScript";
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 Beginner ,
Mar 06, 2025 Mar 06, 2025

First line was:

var aplScript = "set inputData to item 1 of arguments\r";
 
Missed a few chars 🙂
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 ,
Mar 06, 2025 Mar 06, 2025

2753 means that some variable isn't defined?

 

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 Beginner ,
Mar 06, 2025 Mar 06, 2025

I really don't know. Tried to search js errorcodes, but found nothing about -2375.

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 Beginner ,
Mar 06, 2025 Mar 06, 2025

2753... It's been a loooong day.

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 ,
Mar 06, 2025 Mar 06, 2025

But it's rather an AppleScript error code - not JavaScript? 

 

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 Beginner ,
Mar 06, 2025 Mar 06, 2025

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.

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 ,
Mar 06, 2025 Mar 06, 2025

Have you test that the shell script works in terminal with dummy inputData, which I assume is the only thing applicable to inDesign? 

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 ,
Mar 06, 2025 Mar 06, 2025

@Madhawk65

 

What is the inputData - how and what do you set it to in JS before calling doScript()?

 

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 Beginner ,
Mar 10, 2025 Mar 10, 2025

This runs in ID 20.1 and crashes in ID 20.2

 

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

(function() {
if (typeof JSXSSL.crc32 !== "function") {
JSXSSL.crc32 = function(inputFile) {
var argv = [inputFile.fsName.replace(/ /g, "\\ ")];
var aplScript = "set filename to item 1 of arguments\r";
aplScript += "set shellScript to \"crc32 \"\r";
aplScript += "set shellScript to shellScript & filename\r";
aplScript += "do shell script shellScript";
return app.doScript(aplScript, ScriptLanguage.APPLESCRIPT_LANGUAGE, argv);
}
}
}());

alert(JSXSSL.crc32(File.openDialog("Choose file", null, false)));
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 ,
Mar 10, 2025 Mar 10, 2025

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

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 ,
Mar 10, 2025 Mar 10, 2025

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
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 Beginner ,
Mar 10, 2025 Mar 10, 2025

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
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 ,
Mar 10, 2025 Mar 10, 2025

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
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
Adobe Employee ,
Mar 13, 2025 Mar 13, 2025
LATEST

I'm told this is fixed in the next release of InDesign, 20.3.

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