Page 1 of 1

Same line of Script in 1024 CustomScript Buttons

PostPosted: Wed Feb 10, 2016 6:21 pm
by chrisr
Good Afternoon All,
I have a line of script: CurrentButton = MyId. I'd like to take this, and place it into the Mouse Enter Script Box in every CustomScript Button (1024 of them). Is there a way to automate this process? Or am I relegated to opening each CS button and pasting the script in each Mouse Enter Script box ?

Thank you for any insight you might have.

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Thu Feb 11, 2016 9:47 am
by Thomas Mrozek
Hi Chris,
unfortunately there is actually no other workaround for that but copy and paste...
cheers
Thomas

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Thu Feb 11, 2016 2:57 pm
by chrisr
Thanks! So maybe a way around this. I am using the CurrentButton = MyId to fill a variable. Do you know a way to grab a mouse over "MyId" without having to place a script into the button itself? So it could run globally instead of for each individual CS button?

Best,

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Fri Feb 12, 2016 1:06 am
by florian
You can also edit the WDP file in a text editor. With some crafty grep, sed and awk, you could find a way to look for the end of each button line and insert a new line with your argument.

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Sat Feb 13, 2016 12:32 pm
by Dennis Kuypers
Hey,

When copy pasting buttons they keep the script. Create one button with the script, then copy paste.

Dennis

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Mon Feb 15, 2016 6:00 pm
by chrisr
AH Great! I didn't think to try that. I like the copy / Paste idea!

Thanks!

Re: Same line of Script in 1024 CustomScript Buttons

PostPosted: Tue Feb 16, 2016 7:26 pm
by JustynR
You can put variables in the buttons and macro links so you can modify them in the future...

Take the MyID variable and use it to your advantage!
Something like:
Code: Select all
Button_Exec = MyID
WDMacro,Router_Switch


Then your "Router_Switch" Macro can call up the "Button_Exec" variable and do something unique with that number, but have the same global command for all buttons.