Closed for Company Meetings: Between September 18 (5pm PDT) and September 22 (12pm PDT), Support and Sales requests will be delayed. Only time-sensitive issues will be addressed during that time. Thanks for your patience.
well . you can include js content by putting your Utils into Cycling '74/jsextensions/ folder .
This way your functions are seen within every JS project used in max .
Personally i would love to have #include directive as an option and be specific to the current project, but thats not possible without writing a compiler for JS (someone did) ,
every changes require recompiling .
There is third option . Pack your utils into Global object inside one JS instance and access it in another .
U are able to setup a global object in one JS instance, that holds your methods/variables/objects and access them inside other JS instances .
But in Max 7 weve got new directives https://cycling74.com/forums/js-require/ that let us concatinate functionality .
It's very unfortunate that the implementation of JS require is wrong - or at least, it was wrong in the first release of Max 7 (I haven't upgraded, partly for that reason, partly because I have shows coming up and want to wait until there's a break with some time to kill before potentially destabilizing my world. I hear good things about Max 7 but experience with software in general leads me to caution...)
The issue is that you can't refer to files in subdirectories - even though the Common JS spec requires it. It's unfortunate, because most third-party Common JS packages do use subdirectories in their require sections, rendering them incompatible with Max/MSP's JS implementation.
I do hope this gets fixed and I will upgrade to Max 7 the moment it is... hint hint hint! :-) There was some argument last time this came up as to whether this was even a bug but I think the Common JS specification is authoritative in this matter...
Thanks @TOM SWIRLY ! its good to be aware before jumping in . Indeed i would be surprised because i would expect it to behave as its origin .
by the way : Wanst it you who wrote compiler for JS that let us concatinate files ?
Heh, well, I wrote the examples of this, but it actually uses gcc and make, standard tools that are on pretty well every machine!
I'd love to stop having that phase - if nothing else to avoid the error where I change the program and forget to compile them - and perhaps when Max 7 JS handles relative paths I can!
It makes my life much easier when I'm not dragging wires to land on tiny inlets... :-)
Its not popular approach here :) its against Max'ing attitude :D . Since dealing with the coding myself , im patching less for similar reasons , desires and efficiency . But we wont be applaud for this here , its sort of a sin not to wire stuff TOM :)))))))))