scripting query

Sep 26, 2007 at 3:29pm

scripting query

hi

is there a scripting command to select/delete only named objects of a perticular type? ie, could I say something like, “delete only outlets with names”, or even “how many outlets with names are there?”. failing that, is there a command for reporting how many of a particular object are in a patch, named or not?

thanks

robin

#33839
Sep 26, 2007 at 4:11pm

On 26 sept. 07, at 17:29, robin foster wrote:

> is there a scripting command to select/delete only named objects of
> a perticular type? ie, could I say something like, “delete only
> outlets with names”, or even “how many outlets with names are
> there?”. failing that, is there a command for reporting how many of
> a particular object are in a patch, named or not?

For that kind of stuff you need to go JavaScript. There’s a
this.patcher.apply() method which allows you to iterate through all
the objects in your patch. Then you can access to the property of
each objects (in your case, maxclass and varname). Have a look to the
JavaScriptInMax.pdf document. There’s also a nice example of patch
iteration (patchdescribe-example.pat in the examples/Javascript/
patcher-scripting folder).

HTH,
ej

#113250
Sep 26, 2007 at 4:15pm

lovely, thanks
well, probably not lovely at all, but thanks still!

#113251
Oct 1, 2007 at 8:13am

robin foster schrieb:
> is there a scripting command to select/delete only named objects of a
> perticular type? ie, could I say something like, “delete only outlets
> with names”, or even “how many outlets with names are there?”.
> failing that, is there a command for reporting how many of a
> particular object are in a patch, named or not?

Within Javascript I guess, but if you give names with numbers to the
objects, you can easily construct something even more convenient with a
combination of uzi and sprinf…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#113252
Oct 1, 2007 at 11:51am

that’s what i’ve got. the patch allows the user to create x number of objects as required, and my problem was how to let uzi know how many were currently in the patch, so as not to fill the max window with error messages. i’ve solved it now, i was just being a bit dense and using peak to track the highest number created rather than just taking the last value recieved.

#113253

You must be logged in to reply to this topic.