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

[UXP] [SOAP] Unable to get data in scriptResult

New Here ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Hello,

 

I'm using indesign server 2023 with SOAP to send and get back data from documents.

 

Using JSX it worked fine and I was able to get back the data in the response within the <scriptResult> tag.

Since I switched to UXP and idjs the <scriptResult> always comes back empty even though <errorNumber> is 0.

Even a script like the one below or just a "return 1" script does not seem to work for the result.

os = require('os');
app.consoleout(os.release());
script = require('uxp').script;
app.consoleout(JSON.stringify(script.executionContext));
return script.setResult("Hello World");

 

Did anyone successfully use SOAP and got back a response with the correct data ?

 

Thanks for the help

 

 

TOPICS
Bug , UXP Scripting

Views

1.3K

Translate

Translate

Report

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

correct answers 1 Correct answer

New Here , Apr 20, 2023 Apr 20, 2023

Hi @Jakob Frey i got some answers via another channel, and the answer is : the feature is not implemented yet

It should be in a few months 

 

Indesign server is one of the worst developer experience i've had and this "answer" is just another proof on how little they care about developers.

Votes

Translate

Translate
Community Beginner ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

Same behavior for me.

Can we please get support for this issue?

Votes

Translate

Translate

Report

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 ,
Apr 20, 2023 Apr 20, 2023

Copy link to clipboard

Copied

Hi @Jakob Frey i got some answers via another channel, and the answer is : the feature is not implemented yet

It should be in a few months 

 

Indesign server is one of the worst developer experience i've had and this "answer" is just another proof on how little they care about developers.

Votes

Translate

Translate

Report

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 ,
Apr 20, 2023 Apr 20, 2023

Copy link to clipboard

Copied

Thanks for the information.

 

Yes, I have exactly the same experience.

Votes

Translate

Translate

Report

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 ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

@Pavillet26779715bz52 It sounds like you were able to get a .idjs file running via SOAP request to an Indesign Server 2023. I'm attempting the same thing, but I'm getting an error where it claims "Incompatible or unsupported scripting language." and I'm wondering if I've formatted my SOAP request correctly.

Would you mind sharing what that SOAP request looks like?

Votes

Translate

Translate

Report

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 ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

@Darryl Rubarththe following worked for me:

<runScriptParameters>
    <scriptText>
        await app.consoleOut('Test');
    </scriptText>
    <scriptLanguage>UXPScript</scriptLanguage>
    <scriptArgs>
        <name>testarg</name>
        <value>123</value>
    </scriptArgs>
</runScriptParameters>

but it does not work with the "<scriptFile>" tag.

Votes

Translate

Translate

Report

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 ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

@Jakob Frey That's exactly what I needed. I was missing `<scriptLanguage>`. Thanks!

Votes

Translate

Translate

Report

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 ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

@Jakob Frey and others: it seems that using this method, `<scriptArgs>` is ignored as I cannot use `app.scriptArgs.getValue('<arg_name>');` to retrieve the arguments. Is there a new way in UXPScript to access script arguments that I'm missing?

Votes

Translate

Translate

Report

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 ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

Not missing anything, just saw this in their FAQ: https://developer.adobe.com/photoshop/uxp/2022/scripting/how-it-works/#faq

Votes

Translate

Translate

Report

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 ,
Apr 26, 2023 Apr 26, 2023

Copy link to clipboard

Copied

Indesign server is one of the worst developer experience i've had and this "answer" is just another proof on how little they care about developers.

 

Wait, can you be a little more specific? Like which parts of the developer experience were bad and what was bad about them? Since I'm on a developer experience team the answers are important to me...

Votes

Translate

Translate

Report

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 ,
Jan 21, 2024 Jan 21, 2024

Copy link to clipboard

Copied

same for me here.  with a console enabled on the indesign server i get only:

[UXPScript] Executing Script
[UXPScript] Finished Executing Script

With JSX i dont have the same problem, but i need the new JS standard with the fetch api and fs. I have tried console.log, but its ignored, i have tried the script set result, but nothing comes out of the console or in the soap call, return also does nothing. Also i have tried to do a workaround where i save the error in txt file inside the temp folder and then copy it to the desktop, but nothing happens. This workaround works in the normal desktop indesign application, but not in indesign server

...
catch (error)
{
    const filename = "error.txt";
    let file = await tempFolder.createFile(filename, { overwrite: true });
    await file.write(error, { format: formats.utf8  });

    fs.copyFile(file.nativePath , "C:\\Users\\myuser\\Desktop\\error.txt");
}

 

I am trying to implement a fully cloud solution to render our pdfs with aws, but i can not debug why no pdf is being rendered after the soap call, and the scripts i write for desktop indesign, do not seem to work for ids.

If someone has an idea, or has achieved to write a script that does export a pdf, this will be really welcomed!

 

Also it appears to me that when i send the soap request, i get the response way before i see "finished" in the console, which leads me to believe that the script/request is being executed in an async form, so a response is hard to imagine. ---- When i debug the desktop indesign via the uxp dev tool, i can see the idjs is run as IIFE. If this is the case with ids, then of course there is no response - the resposen needs to be polled, as it is async. When i send my request i get 32ms for the response.

Even working with a promise and awaiting for it, doesnt help.

let tempFolder = await localFileSystem.getTemporaryFolder();
let promise = new Promise((resolve, reject) => {
    try 
    {
        ...
        resolve("test");
    } 
    catch (error)
    {
        ...
        reject(error);
});

try {
    let result = await promise;
    console.log(result);
} catch (error) {
    console.error(error); 
}

// OR 

(async () => {
  await promise;
})().catch(e => console.log("Caught: " + e));

@erinferinferinf maybe the IIFE is the problem here, if ids runs idjs scripts the same way as the desktop version.

 

I hope if no one still has a solutiong, that at least this gives someone an idea how this can be resolved. 

Votes

Translate

Translate

Report

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 ,
Jan 21, 2024 Jan 21, 2024

Copy link to clipboard

Copied

I'm starting with server - but from what I've seen - there is error and output function to send your own info.

 

Server doesn't have UI and Clipboard - so no copy / cut / paste - you need to use move and duplicate.

 

Votes

Translate

Translate

Report

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 ,
Jan 21, 2024 Jan 21, 2024

Copy link to clipboard

Copied

I just tried it on IDS 19.0.1 and the setResult works when sending soap requests, but it does not show in the console

const uxpSC = require("uxp").script;
return uxpSC.setResult("Success");

 

Votes

Translate

Translate

Report

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 ,
Jan 21, 2024 Jan 21, 2024

Copy link to clipboard

Copied

LATEST

From what I see in VB6:

 

RobertTkaczyk_0-1705882100142.png

 

RobertTkaczyk_3-1705882136501.png

 

But I'm not JS guy so can't help you with JS coding.

 

Votes

Translate

Translate

Report

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 ,
Apr 20, 2023 Apr 20, 2023

Copy link to clipboard

Copied

As a workaround - try to use Label functionality - store data in the specified Label of the current document - or application - then read it from the main function.

 

Be aware, that reseting preferences will remove labels saved inside application. 

 

 

Votes

Translate

Translate

Report

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