• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
2

ScriptUI: setting size and location of dockable palettes

Community Beginner ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

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

 

Bug Unresolved
TOPICS
Bug , Question

Views

83

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 Comment
Adobe Employee ,
May 07, 2024 May 07, 2024

Copy link to clipboard

Copied

LATEST

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 

Votes

Translate

Translate

Report

Report
Resources