3 Replies Latest reply on Dec 14, 2012 3:23 AM by Pierre Labbe

    Display the dialog box "Step and repeat"

    Pierre Labbe

      I am absolute beginner in script.

      I want to create a script (for InDesign CS6) that just displays the dialog box of the command "Step and repeat" from the Edit menu.

      I tried this :

      app.menuActions.itemByID(43521).invoke();

       

      The dialog box appears and disappears immediately.

       

      Thx for you help.

        • 1. Re: Display the dialog box "Step and repeat"
          Marc Autret Level 4

          Hi Pierre,

           

          I'm afraid this is not doable

           

          In fact, you should have the following runtime error: “The requested action opened an asynchronous previewable modal dialog. This is not compatible with the scripting architecture, and so the dialog has been automatically dismissed using the default button.”

           

          [In French: « L'action demandée a eu pour effet d'ouvrir une boîte de dialogue modale asynchrone prévisualisable. Celle-ci est incompatible avec l'architecture de script et a donc été automatiquement fermée à l'aide du bouton par défaut. »]

           

          Because of the Preview feature it embeds, the Step and Repeat dialog box cannot be safely triggered from a script, even if you emulate the corresponding menu selection:

           

          // THIS WILL FAIL AS WELL:
          // ---
          with( app.menus.itemByName("$ID/Main").
                  menuElements.itemByName("$ID/Edit").
                  menuItems.itemByName("$ID/Step and Repeat...") )
              { isValid && enabled && select(); }
          

           

          Hence, I think there is no way to reach your goal through scripting.

           

          @+

          Marc

          • 2. Re: Display the dialog box "Step and repeat"
            Jump_Over Level 5

            Hi,

             

            To be more optimistic:

            do not give up with your goal!

             

            1. to display this dialog you can use a keyboard shortcut (item is selected)

            2. script could help you to create your own "step_repeat" dialog and to keep your own interaction with user

            3. script could execute step_repeat operation without dialog using your default/calculated/read  values

             

            rgds

            • 3. Re: Display the dialog box "Step and repeat"
              Pierre Labbe Level 1

              Bonjour Marc,

              Merci pour ta réponse.

              Je m'en doutais un peu car avec Configurator 3, j'obtiens le même résultat : la fenêtre ne reste pas affichée.

              Dommage,

              @+

              Pierre