Home › Forums › General › Programming › get componentVisibleName › Reply To: get componentVisibleName
July 19, 2018 at 5:34 am
#84677
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,