Skip to main content
Participant
November 1, 2021
Question

AEScript writeln has stopped working when called from a Window

  • November 1, 2021
  • 1 reply
  • 317 views

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");

 

This topic has been closed for replies.

1 reply

mat lAuthor
Participant
November 5, 2021

to fail to answer my own question well. It seems like a problem is the new debugger. The debug session stops running after the code has finished so it no longer receives input from code run by the created Window. 

For more detail, see this thread for anyone interested.

https://community.adobe.com/t5/exchange-discussions/extendscript-debugger-v1-x-needs-a-rethink/td-p/10423619#11026620

For me, very annoying as I love the new version and the speed improvements. But also love feedback in long, long processes.