|
Thanks for that Stephen,
I’ve managed to make it work by using :
sePsetObject = XSIFactory.CreateObject("scriptEditor");
sePsetObject.Name = "scriptEditor";
previously I had been using
Application.ActiveSceneRoot.AddProperty( "scriptEditor" )
The problem I have now is that commands which relied on PPG.name fail. I suppose this makes sense, since in the scene there is no ‘scriptEditor’ object (Which is what PPG.name used to refer to). For instance I was getting object names using Dictionary.getObject like:
oEditor = Dictionary.getObject(PPG.name + ".editor" + PPG.currentTab);
The above statement used to resolve to scriptEditor.editorx0, whose value I could set.
Now, the only way I can get my code to work is to give the exact object like:
oEditor = PPG.editorx0;
Since I have multiple editors, I have tried (but failed) to use the following ways to get the same result:
oEditor = PPG.PPGLayout.Item(oEditorIndex); oEditor.value = "bla";
where oEditorIndex is the index value of the text editor widget in the ppg. Although oEditor.name gets logged as ‘editorx0’ and oEditor.type shows up as ‘Text Editor Widget’ the value doesn’t change. Any idea as to what I’m missing?
edit: I realize now that I can’t set the ‘value’ of a PPGITem, which is what PPG.PPGLayout.Item(oEditorIndex) returns. Using oEditor = PPG.editorx0, however does return it’s type as parameter. What property do I use to set the contents of a Text Editor Widget?
Thanks
|