How to get properties of an exec ?

BECOME PART OF THE COMMUNITY - Sign up here
  • Hi

    I'm trying to get the function of buttons of an executor.

    Properties are Key and Fader

    How can i get their values with lua code ?

    I can handle the exec and get its name with GetExecutor() and GetExecutor().name

    How can i get properties ?

    i've tried PropertyName and PropertyCount, but it gives me nil values.

    Thank you

    Edited once, last by Bentoylight (April 17, 2023 at 1:02 PM).

  • Thank you Andreas

    That's so obvious :) I haven't given this a second thought !

    But so, how and why use PropertyName(handle, index) and PropertyCount(handle) ?

    I did :

    ex = GetExecutor(205)

    count = PropertyCount(ex)

    Pname = PropertyName(ex,1)

    but this doesn't work. Plugin stops because of calling nill values.

    Thanks Andreas, you're always the best :)

  • Plugin stops because of calling nill values.

    in the global context e.g. PropertyCount doesn't exist

    notice the "(Object API)" classification in the Lua editor API description

    how and why use PropertyName(handle, index) and PropertyCount(handle)

    Code: alternative 1
    return function()
      local ex = GetExecutor(206)
      local count = Obj.PropertyCount(ex)
      for i = 0, count-1 do
        local Pname = Obj.PropertyName(ex, i)
        Echo(Pname)
      end
    end
    Code: alternative 2
    return function()
      local ex = GetExecutor(206)
      local count = ex:PropertyCount()
      for i = 0, count-1 do
        local Pname = ex:PropertyName(i)
        Echo(Pname)
      end
    end

    alt 1 versus alt 2 explanation:

    Andreas
    January 12, 2023 at 11:14 PM

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!