IND 5.0, Actionscript
I have found that the command CSXSInterface.instance.evalScript("alert('x', 'y', false)") works fine in a normal run (i.e., displays the Alert dialog in InDesign), but causes InDesign to crash and close if the same code is run in the debugger.
There's no reason to be using evalScript in InDesign.
Try this method:
Harbs, thank you very very very much for the link. It's very nice technique.
But I have one question to you. Can I pass Array from jsx to sdk? I mean the real array, not a xml of string or anything?
On the very bottom of the post in the link you provided, theres an example:
var d:Document = new Document();
d.hostObjectDelegate = jsxInterface.getDocumentFromJSX();
And it works great, but only for SDK-specific classes, because they have a 'hostObjectDelegate" property/function.
Array doesn't have one, so how can i get an array from JSX?
Yes. You can pass an array, but it will not be an ActionScript Array type.
Something like this:
var jsArray:Object = jsxInterface.getArray();
trace(jsArray); // returns "2".