Script a snippet in to a patch


    Oct 01 2019 | 10:49 am
    Just wondering if there is a message for thispatcher that will allow me to paste a snippet in to the patch. I know you can right click and "paste from" but I'm hoping to be able to create my own menu system for my snippets.

    • Apr 19 2020 | 8:44 pm
      + 1
    • Apr 19 2020 | 10:16 pm
      if anywhere, then in javascript. snippets arent objects...
    • Apr 20 2020 | 1:54 am
      Yup ur right! Anyway I couldn't find anything related on how to add a snippet from js.
    • Apr 20 2020 | 1:27 pm
      If you can load up a snippet from the right click menu then shouldn't there be some way of recreating that action from inside the patch itself?
    • Apr 20 2020 | 1:34 pm
      what technically could be possible is to add a "recording" mode to thispatcher scripting. i am wishing for that for a long time. you wouldnt not need to have invented "snippets" if that would work, you could just save a "thispatcher script" to disk. of course the last created object in the patch will always keep the name, but that would be a minor problem. i have no idea about javascript itself, but if you open a snippet as text you will find that it has a structure similar to a patcher file. the hardest part would be to insert stuff relative to mouse position.
    • Apr 20 2020 | 4:08 pm
      yeah, if you open a maxsnip file in textedit, you can copy the text and just paste it into your patch like you would with a normal patcher, too.
    • Apr 20 2020 | 8:31 pm
      what else would be needed to reproduce the built-in function. find by name, open as text, copy and paste, reposition, set dirty bit. whats more? can snippets contain styles?