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

Pass information from Panel to Script?

Community Beginner ,
Apr 10, 2015 Apr 10, 2015

Hi there,

I wrote a JSX script to generate grid shapes for me automatically, and then used Configurator 4 to create a panel that triggers the script.

This would be a lot more useful if I could have text fields so users can specify how many grid rows, columns, etc., but I don't see any method of doing that in Configurator.

Is there a way to pass user input on a panel into a script?

I'm using CS6.

Eshan

TOPICS
Actions and scripting
447
Translate
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

Advocate , Apr 10, 2015 Apr 10, 2015

Hi eshan.mathur,

I'd say it's not possible, but I'm not a big Configurator 4 expert.

If you need a simple GUI on CS6, I'd suggest using a Scripted Dialog. It's not that hard if you don't need fancy stuff, see this snippet:

var yourFunction = function(first, second, third) {

    // Do whatever you need here

    alert("Params\nFirst: " + first + "\nSecond: " + second + "\nThird: " + third);

}

var res = "dialog { \

    margins: 15, spacing: 20, \

    preferredSize: [200,100], \

    orientation: 'col

...
Translate
Adobe
Advocate ,
Apr 10, 2015 Apr 10, 2015

Hi eshan.mathur,

I'd say it's not possible, but I'm not a big Configurator 4 expert.

If you need a simple GUI on CS6, I'd suggest using a Scripted Dialog. It's not that hard if you don't need fancy stuff, see this snippet:

var yourFunction = function(first, second, third) {

    // Do whatever you need here

    alert("Params\nFirst: " + first + "\nSecond: " + second + "\nThird: " + third);

}

var res = "dialog { \

    margins: 15, spacing: 20, \

    preferredSize: [200,100], \

    orientation: 'column', \

    text: 'Demo Scripted Dialog', \

    alignChildren: ['right', 'top'], \

    \

    firstParam: Group { \

        sText: StaticText { text: 'First Parameter:' }, \

        eText: EditText { \

            characters: 4, \

            text: '10' \

        } \

    }, \

    secondParam: Group { \

        sText: StaticText { text: 'Second Parameter:' }, \

        eText: EditText { \

            characters: 4, \

            text: '20' \

        } \

    }, \

    thirdParam: Group { \

        sText: StaticText { text: 'Third Parameter:' }, \

        eText: EditText { \

            characters: 4, \

            text: '30' \

        } \

    }, \

    buttonsGroup: Group { \

        cancelButton: Button {text: 'Cancel'}, \

        okButton: Button { text: 'OK' } \

    } \

}"

var w = new Window(res);

var retVal = w.show();

if (retVal == 1) { // User clicked OK

    var firstParam  = w.firstParam.eText.text,

        secondParam = w.secondParam.eText.text,

        thirdParam  = w.thirdParam.eText.text;

    yourFunction(firstParam, secondParam, thirdParam);

}

Hope this helps,

Davide Barranca

---

www.davidebarranca.com

www.cs-extensions.com

Translate
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
Community Beginner ,
Apr 10, 2015 Apr 10, 2015

I think that'll be fine for what I'm trying to do. Thanks.

Out of curiosity, if I did want it to be a panel, how would I go about doing this? Would I have to use the actual SDK?

Translate
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
Advocate ,
Apr 11, 2015 Apr 11, 2015

Hi,

If you need an actual panel on CS6 you're right, I'm afraid you have to use the CS SDK (that is, Flash panels) and Extension Builder 2.

Mind you, from CC onwards Flash panels are deprecated in favour of HTML panels (CC supports both, CC2014 and following HTML only).

If you want info about HTML Panels see the official Adobe-CEP/CEP-Resources · GitHub down in the Miscellaneous section, there you'll find tutorials and documentation.

If one of the replies answers to your question, please mark it as "Correct answer", so the thread gets green - we all love green threads in the forum

Regards,

Davide Barranca

---

www.davidebarranca.com

www.cs-extensions.com

Translate
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
Community Beginner ,
Apr 11, 2015 Apr 11, 2015
LATEST

Got it. Thanks for the info. Answer marked.

Translate
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