Friends, colleauges:
Of the many documented properties+methods available in ScriptUI to position and resize dockable ScriptUI palettes in After Effects, most of us have tinkered with:
win.bounds = { Bounds object }
win.windowBounds = { Bounds object }
win.frameSize = [ width , height ]
win.size = [ width , height ]
win.location = [ x , y ]
win.frameLocation = [ x , y ]
..but these don't appear to work anymore. Or, maybe they've gone read-only?
Is there a new, preferred way to script (set, rather than get) the position + location of ScriptUI palettes, or has this functionality been deprecated? Just curious, no pressure.
Below is tests.jsx which creates a dockable window, then alerts the user to different attempts at resizing or repositioning it, using the methods listed above.
When tests.jsx is placed inside AE's ScriptUI Panels folder, the methods don't work.
When tests.jsx is launched from VS Code, the window resizes+relocates as expected.
If this has actually never worked the way I'm describing, and I'm just slow on the uptake - never mind!
Thanks for reading.
// begin tests.jsx
var win =
this instanceof Panel
? this
: new Window("palette", "testing", undefined, {
resizeable: true
});
// alternately use win.show() where appropriate
win.visible = true;
alert("about to try resizing via a bounds object [ x , y , x+width , y+height ]");
var o = {};
o.x = Math.random() * 100;
o.y = Math.random() * 100;
o.width = 200 + Math.random() * 500;
o.height = 200 + Math.random() * 500;
win.bounds = o;
alert("about to try a resize via the win.windowBounds object ");
win.windowBounds = o;
alert("about to try a resize via win.frameSize ");
win.frameSize = [Math.random() * 800, Math.random() * 800];
alert("about to try a resize via win.size = [ width , height ]");
win.size = [Math.random() * 800, Math.random() * 800];
alert("about to try a relocation via win.frameLocation = [ x, y ]");
win.frameLocation = [Math.random() * 800, Math.random() * 800];
alert("about to try a relocation via win.location = [ x , y ]");
win.location = [Math.random() * 800, Math.random() * 800];
// end tests.jsx