Forums > MaxMSP

Checking for existing object names before creation

March 13, 2007 | 12:31 am

Is there a way with thispatcher to query whether a name is already in use by
an existing object. I want to use scripting to create an instance of an
object if the name is not in use and use the object if it already exists.

If objectname does not exist then create it with script new name newex etc.
And send data to the object.
Else send data to the existing object.

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson



_j
March 13, 2007 | 8:09 am

use jasch’s posit object. send "names" to output a list of names local to just the patch posit is located in. send "names.global" and you’ll get all the named objects in any open patch. come up with your own algorithm to test for a match!!

james


March 13, 2007 | 8:25 am

There’s also an object on my share page, pattrexists, which you could
use for this purpose.

jb

Am 13.03.2007 um 09:09 schrieb jamez:

>
> use jasch’s posit object. send "names" to output a list of names
> local to just the patch posit is located in. send "names.global"
> and you’ll get all the named objects in any open patch. come up
> with your own algorithm to test for a match!!
>
> james


March 13, 2007 | 1:57 pm

Perfect!

On 3/13/07 4:25 AM, "Jeremy Bernstein" wrote:

> There’s also an object on my share page, pattrexists, which you could
> use for this purpose.
>
> jb

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


Viewing 4 posts - 1 through 4 (of 4 total)