No internet connection
  1. Home
  2. How to

Count number of buttons in a window

By Alex Oldroyd @Alex_Oldroyd8
    2022-01-26 15:49:33.936Z

    Hi all

    Is there a way to count the number of buttons in a window, and then use that number in the ongoing code?

    Logic names UI Elements based on the number of buttons in the window. if for example you know how many buttons there are in the plugin list window, ie how many plugins are loaded, you know which button number to use for the 1st, 2nd, 3rd plugin slots etc.

    Thanks

    Alex

    • 4 replies
    1. A
      Alex Oldroyd @Alex_Oldroyd8
        2022-01-26 23:28:41.679Z

        Hey @Kitch - is this possible? Thanks :)

        1. Kitch Membery @Kitch2022-01-26 23:38:11.014Z

          I'll say maybe for now... See my post on another thread to understand why. Logic Pro X- UI element inconsistently labelled #post-22

          I'm always up for a challenge so will dig in when I get a chance.

          1. AAlex Oldroyd @Alex_Oldroyd8
              2022-01-26 23:54:02.624Z

              Ah yes. this is exactly why I want to count the number of buttons. Logic seems to assign both plugin slots and send slots ascending from the last slot. So the next (free) slot will always be button 0, the last occupied slot will always be 1 etc. If you can count the number of buttons, you can open the first plugin slot :)

              1. AAlex Oldroyd @Alex_Oldroyd8
                  2022-01-27 00:21:51.107Z

                  I think this could also be a possible solution to the inconsistent button labelling