I’m an in-house developer for a print company.
We use Adobe Indesign CS3 and CS5 to create documents for printing.
I created a script in Adobe Extendscript that creates an Indesign Document and handles some basic conversions when the client fails to do so themselves.
I used Javascript to write this script.
Is it possible to call a web service through such a script?
If so, how?
If not, what would be the best way to call a web service from the desktop?
Thank you.
No and Yes.
No, there is no way (afaik) to make InDesign call a web service from a script. It’s very possible and often done from InDesign plugins (you can execute arbitrary c++ code so you can do whatever). However, that’s an entirely different beast to learn.
Yes, it’s possible to do from ExtendScript using a library. So basically your script would call the web service to get data (maybe using parameters gotten from InDesign or the document) and then send the returned values into other InDesign script functions to perform the operations.
A basic sample can be found here that uses ‘Extendables’.
EDIT: Since there seem to be some confusion: The documents aren’t the ones running the script and very rarely even contain them. The scripts are saved in an InDesign specific Javascript format (.jsx) and interpreted by the InDesign scripting engine.