Skip to main content
Participant
April 25, 2024

ScriptUI: setting size and location of dockable palettes

  • April 25, 2024
  • 1 reply
  • 225 views

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

 

1 reply

Community Manager
May 7, 2024

Hello @T36970192xk9f,

Thanks for bringing this up. Do you know when the functionality was lost? Is it just in the current beta or do you find the sam issue in the release builds? I can look further into it, but wanted to first check where you noticed it wasn't working as expected so I have a place to start. 

All the best,
Jessica McMillan
AE Engineering 

All the best,Jessica McMillan - AE Engineering