5 Replies Latest reply on Apr 13, 2012 10:33 AM by Stephen Huston

    Ordering script

    Luca_Pasini

      Hello, I have this question:

      following you find my script to order filed, where the

       

      Set variable ($OrderingCriteria; Value:Get (ParametroScript)
      I set up this script on each label filed that must be ordered, and this parameter is manually edited for each label button (ex. Name, Surname, Age, etc), while I would like to obtain this parameter directly from the object name (botton name): is there a way to get the button name?
        • 1. Re: Ordering script
          Stephen Huston

          In layout mode you can give each layout object you want to use its own name, via the Inspector's Position panel (top item: name).

           

          Then you can pass the same variable to the script as a calculation: Get ( ActiveLayoutObjectName )

           

          You still have to pass this  script parameter, but you don't have to make it different each time if the object which is the button has been Named.

          • 2. Re: Ordering script
            Luca_Pasini

            My problem is that when I push a button (which is the field label...) named (into the Inspector's Position panel) for example "Surname", this name is not catched by the Get ( ActiveLayoutObjectName ) that you mentioned...

             

            How can I set this button as the active object in the moment that I push it?

            • 3. Re: Ordering script
              Stephen Huston

              Mea Culpa -- you're correct that just pushing th button fails to make it the active object. I found if it was in the tab order and "selected" when pushed, then it returned the correct info the the script, but pushing it when it's not yet selected fails to pass the calc result.

               

              Starts to look like you need to set the parameter differently at each button level, as you had been doing.

               

              Sorry, but I cannot identify any existing Get(function) which will pass the button/object name if it is not previously selected.

              • 4. Re: Ordering script
                Luca_Pasini

                Thank you Stephen anyway.

                But, for your experience, isn't there any other command able to select a button when you push it, letting it become the active object just before the Get ( ActiveLayoutObjectName ) command starts?

                Isn't there any way to use for example the OnObjectKeystroke?

                • 5. Re: Ordering script
                  Stephen Huston

                  I don't believe that will work either.

                   

                  On the other hand, assigning a separate script variable at each button is really no different amount of work than is assigning a unique name to each object you intend to use as a button.