Reference to self
-
I think I remember mentioning this somewhere else but I can't find it so decided to create this thread. I want to know what the best solution is to this situation:
const var scriptIds = Synth.getIdList("Script Processor"); const var scripts = []; for (s in scriptIds) { scripts.push(Synth.getMidiProcessor(s)); }
With this script I get this message
Script Processor:! onInit: Line 6, column 14: You can't get a reference to yourself!
How should I avoid this? Currently I'm using some regex to check if the MIDI processor name matchess
but this means I have to change the regex comparison (script name) every time I use it in a different script. Is there a better way? -
Well the obvious fix is to not include the calling script processor in the list (it has no use anyway). No need to fiddle with Regex here.
-
How do I do that? Please enlighten me sensei.
-
I was talking to myself :)
I'll need to change the function...
-
Should be fixed now.
-
Thank you!