Hi, I have been using this code from Marcus, to create preset buttons for my interface. So far I have used it for plugins that contain up to eight switches. The other day I tried to use the same code for a plug in that had 40 switches, and the script would not load.
Is there a limit to how long a script for a plugin can be? or how many of these switches I can use?
Thanks
CODE FROM MARCUS
You need to create an ISwitch for each Draw setting. The ISwitch will light up when turned on, and you add code so that they turn off the other switches when pressed.
Here’s the code:
[ISubPalette,“Zplugin: Draw Settings”]//create a new sub-palette in the Zplugin menu
[ISwitch,“Zplugin:Draw Settings:32”,0,“Set the Draw Size to 32”,
[ISet,Draw:Draw Size,32]//set draw size
//turn off other switches
[IUnPress,“Zplugin:Draw Settings:64”]
[IUnPress,“Zplugin:Draw Settings:128”]
,.33]//.33 is width of switch - a third of a palette width
[ISwitch,“Zplugin:Draw Settings:64”,0,“Set the Draw Size to 64”,
[ISet,Draw:Draw Size,64]//set draw size
//turn off other switches
[IUnPress,“Zplugin:Draw Settings:32”]
[IUnPress,“Zplugin:Draw Settings:128”]
,.34]
[ISwitch,“Zplugin:Draw Settings:128”,0,“Set the Draw Size to 128”,
[ISet,Draw:Draw Size,128]//set draw size
//turn off other switches
[IUnPress,“Zplugin:Draw Settings:64”]
[IUnPress,“Zplugin:Draw Settings:32”]
,.33]
//Must enable all switches here
[IEnable,“Zplugin:Draw Settings:32”]
[IEnable,“Zplugin:Draw Settings:64”]
[IEnable,“Zplugin:Draw Settings:128”]