I was trying to connect to inDesign server with ColdFusion today, realize there are no code examples in CFM. There are php, java and other language examples in adobe site, but not CFM. This is not the first time I noticed that. When adobe released Spry framework before CF 8, Adobe labs most graciously released php and .net examples, but there were no CFM either. That makes me wonder, is ColdFusion, Adobe's most unfortunate step-child with all the goodness and sweet temper, forced to labor all day in the dark cold kitchen behind the house, while her two sisters playing in the living room wearing pretty dressers all day and attend to most gorgeous balls at night, while coldfusion sat all alone on kitchen cinders with tears in her eyes.
Whatever the reason it may be, connecting to inDesign server with cfm is pretty easy anyway. All you have to do is, connect to inDesign server's WSDL interface. In this example, I'm using cfobject to connect to my inDesign server running in port 18380
Now the next step is build up the SOAP request envelop and send it to runScript() function. With ColdFution, it is as simple as providing correct variable names.
We can provide the path to our inDesign script file
or we can provide inDesign script as a string
If we want, we can send as many as variables you want from ColdFusion in to inDesign in a arrays (or completely ignore this part). Let's send two variables.
Now we are ready to call runScript()
as you can see, there are 3 additional parameters I"m using in here.
errornumber : This is a response variable name for, in any unfortunate case of an error in our inDesign script, for it to output error number in to.
errorfeedback : Same like above. This is for output error details.
Here is everything together :