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
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.
Copy link to clipboard
Copied
Same behavior for me.
Can we please get support for this issue?
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.
Copy link to clipboard
Copied
Thanks for the information.
Yes, I have exactly the same experience.
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?
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.
Copy link to clipboard
Copied
@Jakob Frey That's exactly what I needed. I was missing `<scriptLanguage>`. Thanks!
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?
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
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...
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.
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.
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");
Copy link to clipboard
Copied
From what I see in VB6:
But I'm not JS guy so can't help you with JS coding.
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.