node-activex
node-activex copied to clipboard
Interfacing InDesign
InDesign supports OLE and this code works using microsoft jscript from cmd test.js:
var prog = new ActiveXObject("inDesign.Application.CS6");
prog.doScript("alert('Hello from JavaScript',app.name, false);", 1246973031);
cscript //nologo test.js results in an alert box in InDesign.
The same doesn't work from node.js
var winax = require('winax');
var script1 = "alert('Hello from JavaScript',app.name, false);"
var prog = new winax.Object('InDesign.Application.CS6'); //tested both this and ActiveXObject syntax
prog.doScript(script1,1246973031 );
running this does nothing, and console.log() returns undefined
Am I doing something wrong?
Hello, any ideas regarding this?
Hello, all is correct, but the problem is unclear. May be "code works using microsoft jscript" only started with wscript.exe? Run the script using the console propgram cscript.exe.
2017-11-13 15:32 GMT+03:00 Matas [email protected]:
Hello, any ideas regarding this?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/durs/node-activex/issues/17#issuecomment-343905288, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjGNVdpYY0q5GdKNzAjaYYXdk--sQM2ks5s2DbCgaJpZM4PwaqS .
Hello,
Interfacing InDesign with cscript works

Interfacing InDesign with node+winax does not work

Hello,
This example works with CC 2017 :
require('winax');
var indesign = new ActiveXObject('InDesign.Application.CC.2017',{async:false});
var args = ['Hello from DoScript', 'Your message here.'];
indesign.doScript('alert("First argument: " + arguments[0] + " \\rSecond argument: " + arguments[1]);',1246973031,args);
Hope it will help.
@superdevofficial Thank you, I'll try this.
Because cscript was blocking some of the things i needed to do in indesign, i ended up writing my own middleware.
it would definitely be more elegant without it.