Javascript: changing the assist for an in/outlet in the parent patcher.

Aug 23, 2009 at 10:41pm

Javascript: changing the assist for an in/outlet in the parent patcher.

I’m using Javascript code js box to creating inlets and outlets in the patcher containing that js box.

This works very well – except that I’d like to set the assist for these inlets and outlets. setin/outletassist of course changes the assists for the js box itself.

Any way to do this?

#45204
Aug 23, 2009 at 10:50pm

You set it with the “comment” attribute to [inlet] or [outlet] so from javascript it would be something like:

myinlet1 = this.patcher.newdefault(20,20,”inlet”);
myinlet1.message(“comment”,”this is the assist string”);

I hope that works for you, I haven’t tested it though.

lh

#162890
Aug 23, 2009 at 10:55pm

It definitely works – I just tried it – right on!

And in fact, because of the message/argument duality for Max objects in Javascript, you can use the even simpler form

outlet.comment(‘Kilroy was here’);

(which I also tried).

Thanks!

#162891
Aug 23, 2009 at 10:58pm

Good find! If you have other javascript questions there is a dedicated javascript forum where you are more likely to be answered, also it makes searching the forums easier for future users!

lh

#162892
Aug 24, 2009 at 12:01am

ARG! Potzer’s mistake, thanks!

#162893

You must be logged in to reply to this topic.