As a dynamic form on the form? And how to get their value

Hi all

I want to make a form that would be a granular user to choose from a specific list of values to be passed as a parameter. Here is a script, it creates what I need, but the names of radio buttons are not unique. Can you please how to make, at the end of this form (window), I get the value of the selected radiobutton list item?

#target photoshop
app.bringToFront();
var par = Array("Select your choise","test 1","test 2", "test 3");

var rez = ask(par);
alert(rez)

function ask(par){
wask = new Window('dialog', '');
wask.orientation = "column";
wask.alignment="top";
wask.spacing=0;
    grs0 =wask.add('group');
    grs0.spacing=0;
    grs0.add('statictext', undefined, par[0]);
    grs0.alignment="top";
    grs0.preferredSize.height = 40;
        grs1 =wask.add('group');
        grs1.spacing=0;
        grs1.alignment="left";
        grs1.preferredSize.height = 20*par.length;
        grs1.orientation = "column";
    for(var i=1;i<par.length;i++){
        var g = grs0 +i;
        r= "rb"+i;
        r = grs1.add("radiobutton", undefined, par[i]);
        r.alignment="left";
        }
bt1 = wask.add ("button", undefined, "Select");
bt2 = wask.add ("button", undefined, "Close");

bt1.onClick = function(){

}

wask.show();
}



I think that there are at least two ways to do something like that. One way would be to give the names of controls. You can find and then by name.

var par = Array("Select your choise","test 1","test 2", "test 3");

var rez = ask(par);
if( rez == 1) alert(wask.findElement('rb1').value);

function ask(par){
    wask = new Window('dialog', '');
    wask.orientation = "column";
    wask.alignment="top";
    wask.spacing=0;
    grs0 =wask.add('group');
    grs0.spacing=0;
    grs0.add('statictext', undefined, par[0]);
    grs0.alignment="top";
    grs0.preferredSize.height = 40;
        grs1 =wask.add('group');
        grs1.spacing=0;
        grs1.alignment="left";
        grs1.preferredSize.height = 20*par.length;
        grs1.orientation = "column";
    for(var i=1;i

Another way would be to use an eval statement in the loop that creates the controls. Something like

var par = Array("Select your choise","test 1","test 2", "test 3");

var rez = ask(par);
if( rez == 1) alert(wask.rb1.value);

function ask(par){
    wask = new Window('dialog', '');
    wask.orientation = "column";
    wask.alignment="top";
    wask.spacing=0;
    grs0 =wask.add('group');
    grs0.spacing=0;
    grs0.add('statictext', undefined, par[0]);
    grs0.alignment="top";
    grs0.preferredSize.height = 40;
        grs1 =wask.add('group');
        grs1.spacing=0;
        grs1.alignment="left";
        grs1.preferredSize.height = 20*par.length;
        grs1.orientation = "column";
    for(var i=1;i 
         

Tags: Photoshop

Similar Questions

  • Why my screen captures only half of the size and how to make their return to normal?

    They saved as full size photos, but now when I post one or watch the thumbnail is half white. If I post on facebook, the pictures are too small? Thanks for any help :) using windows 8 and paint on a hp laptop.

    [Moved from the community centre of Participation]

    Half white makes me think that you have activated somehow another monitor (and no additional monitor is probably connected).

    Hold the keys of the keyboard and press P until the first option is selected, and then see if the problem persists.

  • What happened to the Variations of the adjustments and how I get it back? I have Photoshop CC 2015.

    Photoshop CC 2015 version 16.0.

    Windows 10.

    Hi VoidGhost,

    Variations has been removed from the version of Photoshop Creative Cloud.

    Levels, curves, Hue/Saturation. They all allow you to do the same thing, but the user interface is very different. And even aren't the only options, there are a lot of ways to spend the balance of the colors in a picture.

    Kind regards

    Tanuj

  • I am trying to fill out a form and when I get to a certain part what I type is duplicated all the way down the rest of the form.

    I am filling a form and when I get to a certain part, what I'm typing is duplicated to the bottom of the page.

    Who would say that the form has been successfully created.  What is a public form?  If so, can you post a link to it?

  • Why are my tool fill and sign not appearing is not on the bar and how do I solve this problem.

    Why are my tool fill and sign not appearing is not on the bar and how do I solve this problem.

    Salvation;

    What version of Acrobat or Reader are you using?  When you open the form are the fields highlighted and "complete" without clicking the 'Fill & Sign' tool to open the bar fill tools & sign?

    I suspect that the form that you opened is already ' to fill' so the fill tool & sign just offers you the possibility to sign the PDF and all filling out forms is managed the the Acrobat/Reader native app.  In the view below, I opened a 'Acroform' which is a PDF file that has form fields to fill and so the bar fill tools & sign has only 'Sign' button - it's what you see?

    'Fill & sign' tools are to fill PDF documents that have no form fields real (they are flat and not fillable) and is able to add text fields, annotations and signatures for the "flat" PDF

    Thank you

    Josh

  • What is the menu item "Bring everything to the front ', and how to use it?

    What is the menu item "Bring everything to the front ', and how to use it?

    It's a selection in the window menu and means to bring all open windows of this application at the front and push all the windows open for other applications behind. This makes access to the easiest application windows. However, if you don't have that one window open in an application, then the menuitem does nothing.

  • During the closure after a browsing session I find several windows behind the window of the main browser I have not opened and they must be closed individually. What is the cause and how can I stop it?

    During the closure after a browsing session I find several windows behind the window of the main browser I have not opened and they must be closed individually. What is the cause and how can I stop it? Edit

    These windows display ads? They could be 'pop-under' designed to show when you are finished with your main window. Orbitz has these, for example. Irritating. I'm not sure of the best solution, i.e., advertising blocker blocker vs.

    If they are not ads, can you think anyway that they are related to the sites you visit?

    In addition, to close a tab (or window, if there is only one tab), you can press Ctrl + w. could speed up the process of their release until you find a real solution.

  • where and how to get the new Firefox add - one of who is spying on us. Please mail to...

    Heard speak adds the new on Fire Fox. Where and how to get the new Firefox add - one of who is spying on us. Please mail to maheshubhayakar at rediffmail.com

    edited by email address - moderator

    It is helpful if you provide a link to the article you were reading.

  • Why can't an iBook on iTunes in South Africa? They promote the iBooks and iBooks author on their Web site, but it seems that SA is not on the list of countries of distribution. Same tax iBooks are not available. Someone know why? Thank you.

    Why can't an iBook on iTunes in South Africa? They promote the iBooks and iBooks author on their Web site, but it seems that SA is not on the list of countries of distribution. Free IBooks are not available. Someone know why? Thank you.

    Liz...

    According to Apple eBooks aren't yet available > > I can buy on the iTunes Store in my country?

    Simply because Apple makes the promotion of iBooks does not necessarily that they are available in all locations.

    Sorry!

  • After that I closed the lid on my laptop, when I reopen it, I have to keep moving the lid until I can get a picture. What could be the problem and how to fix?

    After that I closed the lid on my laptop, when I reopen it, I have to keep moving the lid until I can get a picture.  What could be the problem and how to fix?

    Hello

    Looks like a loose connector or a short circuit in the video cable. Check with a real
    store computer (one that works on computers cell phones internal ASUStek) or ASUStek
    Support, their documentation and online in their forums.

    Not a maintainable question by the user.

    ASUStek support
    http://support.ASUS.com/

    ASUStek Forums
    http://VIP.ASUS.com/forum/default.aspx?SLanguage=en-us

    ASUStek drivers
    http://support.ASUS.com/download/download.aspx?SLanguage=en-us

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Poker: need to know about the subject and how to play the game

    need to know the subject and how to play the game

    Hi young,
     
    Thank you for visiting the website of Microsoft Windows Vista Community.
     
    I noted that you want to know how to play the game of Poker in vista.
     
    What is Hold em Poker: The Hold em Poker game is a Windows Ultimate Extra that is available for users of Windows Vista Ultimate Edition. You can download the Hold 'em game from the Microsoft Windows Update Web site.

    Hold em Poker is a poker game on computer in which you compete against the computer. The hold 'em game uses the technology Microsoft DirectX to deliver smooth, animated play and rich graphics. You can configure the Hold em option set to perform the following operations:
    Play against up to five computer players
    Set the skill level of opponents
    Customize the appearance of the game cards and game table
     
    For more, see: http://support.Microsoft.com/default.aspx/KB/932925
     
    How to play: When you open the Poker game window, press F1 and it will open the Help window. The help section you have all instructions and details on how you can play the game.
     
    You can visit the link http://forums.gamesforwindows.com/ to find other members of the community have to say. You can search the Internet for more links learn more about the game of poker.

    Kind regards
     
    Srinivas
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • my file were gone in all menu programs start but it still usable in the c drive... Why? and how to get back to normal

    my file were gone in all menu programs start but it still usable in the c drive... Why? and how to get back to normal?...

    its empty in all programs but available to the c drive... can someone help me? /

    The elements of the start menu are a few shortcuts to the files on the C: drive you mention.  Done that caused all the elements of Start Menu to disappear?  This is sometimes caused by viruses that hide items on the computer, make sure that the computer is virus free, run a Malwarebytes scan on the machine.  If the machine is free virus that then I suggest that you do a system restore to a point just before the problem started.

    John

  • When I start my laptop script error on the screen.what that means and how it get rid you

    When I start my laptop SCRIPT ERROR comes on my screen. What it means and how to get rid

    You have assigned to a category of forum that is completely different to your question/problem. Your question has been moved to a forum category that matches it's better.

    If you don't already specify the product name, Windows version, version of the program and other necessary information on the product you have a problem with: do so immediately!
    And please explain the problem more in detail. Do not try to give an overall summary abstract with terms invention. Use natural language. Explain step by step what you do and what you see and why it is a problem.
    Provide accurate and complete data: exact error message of name, exact product of exact, exact file names, exact address... you get!

  • Reactivate microsoft reader, but when I get on the site and I try get a 500 Server error

    Original title: 500 Server error.

    I'll have to re-enable the drive of microsoft, but when I get to the site and try I get a server 500 error is it possible around that I have hundreds of books with a value of eBooks that I can't access

    Original title: 500 Server error.

    I'll have to re-enable the drive of microsoft, but when I get to the site and try I get a server 500 error is it possible around that I have hundreds of books with a value of eBooks that I can't access

    Problem solved by other means.

  • How can I actually email the scan, and how can I check this virus?

    SENDING A SCAN

    I am currently using Internet Explorer 8 and want to send someone using Internet Explorer 8

    How do I actually email the scan AND how can I check this virus

    Internet Explorer is a Web browser, not an e-mail program... To send messages, you need an e-mail account and the recipient needs an e-mail account. You need to know your email address and you must know the e-mail address of the recipient.
     
    Download and run the free versions of these two programs to check the software malicious & software unwanted spies.
     
     

Maybe you are looking for