AEScript writeln has stopped working when called from a Window
In the attached code, the writeln called from the Window I have created is not displaying in the debug console. The other two do work. This has come up during the upgrade to Visual Studio code and AE V22 and was working previously in the extendscript sdk. This is obviously a simplified code version. I have an extensive toolkit in AE and would like to see the console results. Any thoughts, am I missing the obvious?
$.writeln("This Works");
function myScript(thisObj) {
function myScript_buildUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Test writeln", undefined, { resizeable: true });
var res = "group{orientation:'row',\
myTabbedPanel: Panel{type:'tabbedpanel', text:'',\
myTab1: Panel{type:'tab', text:'Test',\
myTabContent1: Button{text:'Writeln will not work'}\
},\
},\
}";
myPanel.grp = myPanel.add(res);
myPanel.grp.myTabbedPanel.myTab1.myTabContent1.onClick = function () {
$.writeln("This No Workie");
alert(this.text + " button clicked");
}
return myPanel;
}
var myScriptPal = myScript_buildUI(thisObj);
if (myScriptPal != null && myScriptPal instanceof Window) {
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
$.writeln("This Works");
