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)

    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 matches s 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?

  • administrators

    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.

  • administrators

    I was talking to myself :)

    I'll need to change the function...

  • administrators

    Should be fixed now.

  • Thank you!

Log in to reply

Looks like your connection to Reference to self was lost, please wait while we try to reconnect.