Reply To: get componentVisibleName

Home Forums General Programming get componentVisibleName Reply To: get componentVisibleName

#84677
dnaldoog
Participant
  • Topics: 4
  • Replies: 480
  • Total: 484
  • ★★

This works.

Tone_Name="piano"
panel:getModulatorByName("Fav_Button_Name"):getComponent():setPropertyString("componentVisibleName",tostring(Tone_Name))

getModulatorByName expects a const string as an argument, but by passing Fav_Button_Name you are passing a non existent Lua variable.

The tostring() function is necessary if you are passing an integer, but not necessary in this case.

You could also do this to write the Fav_Button_Object Visible Name with the name of the button you clicked.


myMethod = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)

--panel:getComponent(tostring(x)):setPropertyString("componentVisibleName",tostring(x))
local mName= L(mod:getName())
Fav_Button_Name=panel:getModulatorByName("Fav_Button_Name"):getComponent()
Fav_Button_Name:setPropertyString("componentVisibleName",mName)
end

Regards,

Do NOT follow this link or you will be banned from the site!