Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Script UI Panel in .jsx meant to be dock-able for After Effects. keeps breaking

  • Script UI Panel in .jsx meant to be dock-able for After Effects. keeps breaking

    Posted by Spence Armajo on March 30, 2025 at 8:27 am

    I am having an issue with a Script UI Panel .jsx when making it dock-able. The Floating Window .jsx is fine, but the dockable .jsx script is having issues. I have a 3×5 grid layout for buttons that allow me to create comps at different frame rates or aspect ratios with a push of a button. What would be a good approach to solving my issue at hand?

    Here is what I have so far and what I am having some issues with.

    var button_margin = 20,

    button_width = 160,

    button_height = 35,

    top_margin = 80,

    panel_margin = 10;

    var l_button_left = button_margin,

    l_button_right = l_button_left + button_width,

    m_button_left = l_button_right + button_margin,

    m_button_right = m_button_left + button_width,

    r_button_left = m_button_right + button_margin,

    r_button_right = r_button_left + button_width,

    t_button_top = top_margin,

    t_button_bottom = top_margin + button_height

    m_button_top = t_button_bottom + button_margin,

    m_button_bottom = m_button_top + button_height,

    b_button_top = m_button_bottom + button_margin,

    b_button_bottom = b_button_top + button_height;

    var win_width = (panel_margin * 2) + (button_width * 3) + (button_margin * 4),

    win_height = (panel_margin * 2) + (button_height * 3) +(button_margin * 3) + top_margin,

    panel_right = win_width – panel_margin,

    panel_bottom = win_height – panel_margin;

    var win = new Window(‘palette’, ‘Docked Comp Creator’),

    panel = win.add(‘panel’, [panel_margin, panel_margin, panel_right, panel_bottom]),

    divider0 = panel.add(‘panel’, [l_button_left, panel_margin * 4, r_button_right, panel_margin * 4]),

    divider1 = panel.add(‘panel’, [l_button_right + (button_margin / 2), t_button_top – (panel_margin * 2.5), l_button_right + (button_margin / 2), b_button_bottom]),

    divider2 = panel.add(‘panel’, [m_button_right + (button_margin / 2), t_button_top – (panel_margin * 2.5), l_button_right + (button_margin / 2), b_button_bottom]),

    label0 = panel.add(‘statictext’, [m_button_left, panel_margin, m_button_right, button_height], ‘Click to create the desired comp.’),

    label1 = panel.add(‘statictext’, [l_button_left + (button_width / 2) – 12, t_button_top – 22, l_button_right, t_button_top – 12], ’16:9′),

    label2 = panel.add(‘statictext’, [m_button_left + (button_width / 2) – 12, t_button_top – 22, m_button_right, t_button_top – 12], ‘9:16’),

    label3 = panel.add(‘statictext’, [r_button_left + (button_width / 2) – 10, t_button_top – 22, r_button_right, t_button_top – 12], ‘1:1’),

    button0 = panel.add(‘button’, [l_button_left, t_button_top, l_button_right, t_button_bottom], ‘23.976 fps’),

    button1 = panel.add(‘button’, [l_button_left, m_button_top, l_button_right, m_button_bottom], ’24 fps’),

    button2 = panel.add(‘button’, [l_button_left, b_button_top, l_button_right, b_button_bottom], ’30 fps’),

    button9 = panel.add(‘button’, [l_button_left, m_button_top, l_button_right, m_button_bottom], ‘59.94 fps’),

    button10 = panel.add(‘button’, [l_button_left, b_button_top, l_button_right, b_button_bottom], ’60 fps’),

    button3 = panel.add(‘button’, [m_button_left, t_button_top, m_button_right, t_button_bottom], ‘23.976 fps’),

    button4 = panel.add(‘button’, [m_button_left, m_button_top, m_button_right, m_button_bottom], ’24 fps’),

    button5 = panel.add(‘button’, [m_button_left, b_button_top, m_button_right, b_button_bottom], ’30 fps’),

    button11 = panel.add(‘button’, [l_button_left, m_button_top, l_button_right, m_button_bottom], ‘59.94 fps’),

    button12 = panel.add(‘button’, [l_button_left, b_button_top, l_button_right, b_button_bottom], ’60 fps’),

    button6 = panel.add(‘button’, [r_button_left, t_button_top, r_button_right, t_button_bottom], ‘23.976 fps’),

    button7 = panel.add(‘button’, [r_button_left, m_button_top, r_button_right, m_button_bottom], ’24 fps’),

    button8 = panel.add(‘button’, [r_button_left, b_button_top, r_button_right, b_button_bottom], ’30 fps’);

    button13 = panel.add(‘button’, [l_button_left, m_button_top, l_button_right, m_button_bottom], ‘59.94 fps’),

    button14 = panel.add(‘button’, [l_button_left, b_button_top, l_button_right, b_button_bottom], ’60 fps’),

    win.bounds = [0,0,win_width,win_height];

    win.center();

    win.show();

    button0.onClick = function()

    {

    app.project.items.addComp(‘horizontal – 16:9 – 23.976’, 1920, 1080, 1, 30, 23.976);

    }

    button1.onClick = function()

    {

    app.project.items.addComp(‘horizontal – 16:9 – 24’, 1920, 1080, 1, 30, 24);

    }

    button2.onClick = function()

    {

    app.project.items.addComp(‘horizontal – 16:9 – 30’, 1920, 1080, 1, 30, 30);

    }

    button3.onClick = function()

    {

    app.project.items.addComp(‘vertical – 9:16 – 23.976’, 1080, 1920, 1, 30, 23.976);

    }

    button4.onClick = function()

    {

    app.project.items.addComp(‘vertical – 9:16 – 24’, 1080, 1920, 1, 30, 24);

    }

    button5.onClick = function()

    {

    app.project.items.addComp(‘vertical – 9:16 – 30’, 1080, 1920, 1, 30, 30);

    }

    button6.onClick = function()

    {

    app.project.items.addComp(‘square – 1:1 – 23.976’, 1080, 1080, 1, 30, 23.976);

    }

    button7.onClick = function()

    {

    app.project.items.addComp(‘square – 1:1 – 24’, 1080, 1080, 1, 30, 24);

    }

    button8.onClick = function()

    {

    app.project.items.addComp(‘square – 1:1 – 30’, 1080, 1080, 1, 30, 30);

    }

    button9.onClick = function()

    {

    app.project.items.addComp(‘horizontal – 16:9 – 59.94’, 1920, 1080, 1, 30, 59.94);

    }

    button10.onClick = function()

    {

    app.project.items.addComp(‘horizontal – 16:9 – 60’, 1920, 1080, 1, 30, 60);

    }

    button11.onClick = function()

    {

    app.project.items.addComp(‘vertical – 9:16 – 59.94’, 1080, 1920, 1, 30, 59.94);

    }

    button12.onClick = function()

    {

    app.project.items.addComp(‘vertical – 9:16 – 60’, 1080, 1920, 1, 30, 60);

    }

    button13.onClick = function()

    {

    app.project.items.addComp(‘square – 1:1 – 59.94’, 1080, 1080, 1, 30, 59.94);

    }

    button14.onClick = function()

    {

    app.project.items.addComp(‘square – 1:1 – 60’, 1080, 1080, 1, 30, 60);

    }

    John Martin
    replied 1 year, 2 months ago
    2 Members · 1 Reply
  • 1 Reply
  • John Martin

    April 9, 2025 at 1:56 pm

    upload the current Jsx, i’ll debug it for you

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy