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

Is it possible to script a tabbed ui?

Participant ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

Is it possible to script a tabbed ui like this, i can't seem to get it to work, please help...

Cheers Daniel.

My script for now:

#target illustrator

tabbed_ui();

//Functions

function tabbed_ui(){

   

    res =

    "dialog {text:'Adres database:', properties:{resizeable:false }, \

        maintabpanel: TabbedPanel { text:'', \

            subtab1panel: Tab { text:'Tab1', \

            }, \

            subtab2panel: Tab { text:'Tab2', \

            }, \

        }, \

    }";

   

    wininfo = new Window (res);

    wininfo.frameLocation = [100, 100];

    wininfo.margins = 0;

   

    // Control Escape key

    wininfo.addEventListener('keydown', function (k) { 

        if (k.keyName == 'Escape') {

            wininfo.close();

        }

    });

    wininfo.center();

    wininfo.show();

};

TOPICS
Scripting

Views

1.4K

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

correct answers 1 Correct answer

Enthusiast , May 26, 2012 May 26, 2012

Resource string not work here, but regular code will work.

var w = new Window ("dialog", "Adres database:");

var tpanel = w.add ("tabbedpanel");

var subtab1panel = tpanel.add ("tab", undefined, "Tab1");

var subtab2panel = tpanel.add ("tab", undefined, "Tab2");

w.show();

Since resource-based style is hard to debug, you'd better always use code-based style.

Votes

Translate

Translate
Adobe
Enthusiast ,
May 26, 2012 May 26, 2012

Copy link to clipboard

Copied

Resource string not work here, but regular code will work.

var w = new Window ("dialog", "Adres database:");

var tpanel = w.add ("tabbedpanel");

var subtab1panel = tpanel.add ("tab", undefined, "Tab1");

var subtab2panel = tpanel.add ("tab", undefined, "Tab2");

w.show();

Since resource-based style is hard to debug, you'd better always use code-based style.

Votes

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
Explorer ,
Mar 26, 2013 Mar 26, 2013

Copy link to clipboard

Copied

LATEST

Resource strings do work with tabbed panels, you just have to call it out as a panel and set its "type:" to "tabbedpanel", and to create tabs you create new Panels as children and call out their "type:" as "tab".

Link to thread that explains this.

Res code that will work for you:

res =

    "dialog {text:'Adres database:', properties:{resizeable:false }, \

        maintabpanel: Panel { type: 'tabbedpanel', \

            subtab1panel: Panel { type: 'tab', text:'Tab1', \

            }, \

            subtab2panel: Panel { type: 'tab', text:'Tab2', \

            }, \

        }, \

    }";


Votes

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