I use a custom script button, when it is pressed a script is executed, my goal would be to copy that script and paste it in the 119 other buttons, as is and the script would work without modifying the code. My only problem at this point is I don't seem to be able to retrieve the ID of the current button (the button into which the script is located), if I could a bunch of stuff could be automated and the copy paste would work.
Why? This way I could add buttons to my project without having to copy/paste from another button and spend time changing the references in the script, I could change the code once and just copy/paste it to all other button rather than tediously going in each button and adapt it.
- Code: Select all
VGetCurrentControlID, currentbutton
VMultiply,textbox1,currentbutton,2
VSubstract,textbox1,textbox1,1
VMultiply,textbox2, currentbutton,2
SO, if I paste that code in ANY button, as long as I make sure the ID is good it will work and call the right elements when executing, for button ID 1 the textbox containing the value inputed by the user will be ID 1 and textbox containing the second value inputed by the user will be ID 2, for button 300, the textbox IDs will be 599 and 600 without ever having to change anything in the script, all I have to so is make sure the button and textboxes are ID'd correctly.
Now there is probably a way to do that (or equivalent) already and I just have to know how but I looked into nodes and script command list and I could not find what I was looking for.
Anyone here did this or equivalent or know it's not possible? Please share
Thank you very much for your help, these forums have proved very helpful.
regards