get patcher name (again)


    Jul 17 2007 | 12:28 pm
    Hi.
    1st of all, sorry if this sounds very easy and stupid to you but these are my very first steps into JS.
    I'm trying to get a bpatcher scripting name from inside of it.
    I've searched on the javascript list and tried different scripts but can't get it working.
    Now I have a really simple js and I place it inside a named bpatcher and I only get when I ask for his scriptname.
    If someone could have a look at the following example...
    (I also have the js inside a patcher to compare)
    ____________________________________
    getname.js
    function bang()
    {
    post(this.patcher.varname);
    }
    ____________________________________
    testgetname.pat
    ____________________________________
    main patcher
    Thanx.

    • Jul 17 2007 | 1:02 pm
    • Jul 17 2007 | 1:05 pm
      That should be
      function bang()
      {
      post(this.patcher.box.varname);
      }
      Check it out in javascriptinmax.pdf, the varname property belongs to Maxobj, not to Patcher
      hth,
      Mattijs
    • Jul 17 2007 | 1:20 pm
      ach sooo !
      I should sleep a little bit more before trying to understand this javascriptinmax.pdf :)
      Many thanx to both of you !
      Cheers.