3 Replies Latest reply on Jan 16, 2013 5:36 AM by Peter Kahrel

    check box EXPORT Options

    hurix@123 Level 1



      I have a script for EXPORT Options.



        function displayDialog(){

                var arrSizes = ['XML'];

          var arrSizes1 = ['WEBPDF'];

          var arrSizes2 = ['PS'];

          var arrSizes3 = ['EPUB'];

                var win = new Window('dialog');

          var stxPrompt = win.add('statictext', [0, 0, 200, 20], 'EXPORT OPTIONS');

                var Checkbox = win.add('checkbox', [50, 30, 250, 50], arrSizes);

                    var Checkbox = win.add('checkbox', [50, 30, 250, 50], arrSizes1);

                        var Checkbox = win.add('checkbox', [50, 30, 250, 50], arrSizes2);

                            var Checkbox = win.add('checkbox', [50, 30, 250, 50], arrSizes3);

                var btnOK = win.add('button', [0, 60, 100, 80], 'OK');


                var strChoice = Checkbox.selection;


      if(strChoice !=null){


      case "XML":

                      app.doScript(new File("/Volumes/HPP/1_Delivery/Prepress/5_Production/Book/Sage_Books/P16230510_Sage Books_XML/Templates/PHOTINO/FULL BOOK/SCRIPT/Post Process.jsx"), ScriptLanguage.JAVASCRIPT);


                          case "PS":

                      app.doScript(new File("/Volumes/HPP/1_Delivery/Prepress/5_Production/Book/Sage_Books/P16230510_Sage Books_XML/Templates/PALATINO/FULL BOOK/SCRIPT/Post Process.jsx"), ScriptLanguage.JAVASCRIPT);





      when i click XML and PS options and then OK there is no action is running.


      Please suggest me.




        • 1. Re: check box EXPORT Options
          Jump_Over Level 5



          At first look:

          You have to insert "case" code into "{}":


          case"XML":{your code; your code; break;}



          • 2. Re: check box EXPORT Options
            Vamitul Level 4

            jump. nope. the syntax for case does not require {};

            hurix..the problem is tha your dialog is a.. 'dialog', so it's modal. while it is active, you cannot interact with indesign.

            a quick fix: var win = new Window('palette');

            should work

            • 3. Re: check box EXPORT Options
              Peter Kahrel Adobe Community Professional & MVP

              Some problems with your code:


              - checkboxes have a value property, they don't have a selection property;

              - you add four checkboxes, but you assign them to the same variable, so the script sees just the last defined instance;

              - why do you define the text labels for the checkboxes as arrays? This is not necessary.

              - you probably want radiobuttons, not checkboxes -- is that so?

              - the check whether strChoice is null is not needed because Checkbox (be it a checkbox or a radiobutton) always has a value;