ensure js files are in search path
Im using some js in an amxd device. When I save the paths into a folder called "abstractions" in my search path, they get recalled just fine on windows. However, as soon as I move this device to a mac, it loses the js files.
Is there any way to embed the js file into the amxd, so I dont have to worry about where the path might end up depending on the OS? Or maybe there is another way?
On my mac ive tried the following:
1) put the files in the search path (abstractions)
2) put the files in the jsextensions folder
3) created a maxpat file instead of a patcher, saved the js files in the same folder as the maxpat
4) freeze the device
None of these work. It seems that it will be very difficult to make sure that when someone opens this patch, that the js will get loaded. Also all the inputs/outputs in the maxpat have become disconnected when the js file cant be found, so the user will also need to go into the patch and connect all these up.
Any help on solving this one would be most appreciated.
Freeze the device. The dependencies, including JS source files, will be automatically included in the frozen device.
its weird, for some reason it isnt including the files when I freeze. I am transferring the device from windows to mac, could that be a problem?
It shouldn’t be. To confirm, you are using Max 6.1?
In Max 5 and 6.0.x, it’s a different story. In that case, you’re better off having the .js next to the device on disk.
If you’re on Max 6.1, please attach a) the frozen device and b) the unfrozen device + .js and we’ll see if we can reproduce.
Im on max 5. I finally got it to work. It was strange because I had to save when I added the js to each patcher, rather than just saving the parent patch.
I’m working on a device that uses 3rd party externals, and some of them need to load a database
when the device is loaded.
I’m using subfolders for the database files to keep things organized, and I included the folders in dependencies.
Everything works fine in the MaxMSP environment (the edit button) but when I go back to ableton environment it seems that doesn’t find them.
I’m kind of lost here… :(
Its a nightmare isnt it.
There are two ways I have found that work, to load the js files.
1) Load them in the same folder as the amxd.
2) Load them in the search path somewhere.
No 1 always worked, but is a bain to have to manage those files.
No 2 now seems to work ok (now max 6.3 is out)
Probably best thing to do is to stick the files in the search path somewhere, then go to your object and save them in there, to the specific location in the search path.
Hope it helps.
Thanks for reply @newtfish.
Like you suggested I moved every file the same folder of the amxd and works fine, BUT, after I edit the dependencies to include the files related to the device for freezing, the paths aren’t recognizable anymore (at this moment the device wasn’t freezed yet). It seems that the paths changed somehow.
I included some devices in the attachments to exemplify what is going on.
[paths.amxd] uses absolutes paths to access files in the HD.
[paths2.amxd] uses absolutes paths also, but now dependencies have been edited to include the files related to the device.
Basically in the end after freezing the device, I would like to be able to load some files that are supposed to be included in the device, but it seems that including these files in dependencies changes also the behavior of accessing them.
When you unfreeze, it is probably putting your files into the unfrozen folder. On a mac this is :Documents\Max\Max For Live Devices\[Title of your project]
Could it be calling/saving your patches from there?
You could try deleting all different maxpats and then just putting the ones you want into one folder. Then freezing it? (if you unfreeze again remembering to delete the unfrozen ones)
Sorry, the post I made above was in relation to a device that isnt being frozen. I gave up on freezing and trying to include the dependant files and opted for the user to just install all dependant files in the same folder as the amxd.
I tried loading your patches, but couldnt quite work out what it is your trying to do. Is there any chance to simplify them and maybe put some notes inside? Maybe putting just notes and deleting the content like "this is 1st patch", "this is edited patch, but not turning up in the right place"