4 Replies Latest reply on Oct 12, 2009 2:01 PM by LeeShort

    ExtendScript Pushbutton?

    LeeShort

      I can't seem to find anything in the ExtendScript reference docs that lets me create a pushbutton.  I"d really like to be able to have the user enter their script parameters, then enter a filename and the "Save" button, then be able to use the "Load" button to recall those parameters for the next session.

       

      Is there any thing in ExtendScript that will do this?  I have a hard time believing that there is not, but I sure can't find it.

       

      thanks

      Lee

        • 1. Re: ExtendScript Pushbutton?
          Peter Kahrel Adobe Community Professional & MVP

          Lee,

           

          Read the chapter "User-interface tools" in "JavaScript Tools Guide CS4.pdf", which you can open in Help > JavaScript Tools Guide CS4 (that's in CS4l in CS3 it's Help > SDK > JavaScript Tools Guide CS3" (it's basically the same document).. The document tells you everything you always wanted to know about buttons.

           

          Peter

          • 2. Re: ExtendScript Pushbutton?
            LeeShort Level 1

            Thanks, Peter,

             

            That seems to have the info I need if I'm using the Script UI toolkit.

             

            However, the script I"m modifying used a different programming model. I'd rather not rewrite the whole script in the Script UI model if I don't have to.  I've enclosed a sample of the script below:

             

             

                var myDialog = dialogs.add({name:"TableStyle v1.5.1"});
                with (myDialog.dialogColumns.add()) {
                    with (dialogRows.add().dialogColumns.add()) {
                        with (dialogRows.add()) {
                            staticTexts.add({staticLabel:"Edit tables in: "});
                            var myRadioButton = radiobuttonGroups.add();
                            with(myRadioButton){
                                var mySelectRadioButton = radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
                                var myDocRadioButton = radiobuttonControls.add({staticLabel:"Document"});
                                var myStoryRadioButton = radiobuttonControls.add({staticLabel:"Story"});
                            }               
                        }

                        with (dialogRows.add()) {
                             staticTexts.add({staticLabel:"Filename: "});
                             var myFileNameBox = textEditboxes.add({editValue:myFilename, minWidth:300});

                            //

                            //  *** add button here, but the code below doesn't work ***

                            var mySaveButton = Buttons.add({staticLabel:"Save"});

            • 3. Re: ExtendScript Pushbutton?
              Peter Kahrel Adobe Community Professional & MVP

              That's ESTK's/Indesign's "classic" dialog model. It doesn't have pushbuttons I don't think. If you really want pushbuttons I guess you'll have to bite the bullet and switch to scriptUI. It's not as intimidating as you'd think, and there are some layout utilities around which make building scriptUI interfaces a breese. One that's free is "autoLayoutCreator" at http://www.scriptuibuilder.com/ (look in the last box, "Other scripts". It works very well.

               

              Peter

              • 4. Re: ExtendScript Pushbutton?
                LeeShort Level 1

                I needed to use Script UI.

                 

                thanks for the help, Peter