Communication javascript and maxscript

Hey all,

I wanted to ask if it would be possible to send some kind of data from a javascrip to a maxscript.

I am just checking on something with javascript in photoshop. And if the condition would be true, it would send a integer or bool to 3ds max. So a script that I wrote would know that he has to call a function.

My first thought was to change the filename of the psd with the javascript. That file will be checked by 3ds max and if there is a change in the filename, then he will call the function.

Is this a good idae or is there a better way?

Greetz

Hi Nysuatro:

You can try establishing a COM connection. See more information here

http://forums.cgsociety.org/showthread.php?f=98&t=509631

The idea is you register some COM functions inside 3dsmax and then you can do a COM connection to max and call them with any language that supports this functionality (in the example, in python via wincom).

The other way it’s similar to the one you described. Writing a file where you can put the information you desire (managed with a lock file). Both programs (the one who reads and the one who writes) have to check the lock file to see if they can write or read the file.
Then you must establish a loop (or a timer) to do the pooling.

Hope it helps.

Best regards

Ok, Thank you

I am going to post it here.

Is there a way to run a javascript while working in photoshop ? When we run a javascript in ps we can’t work anymore in ps.

We have written a script to update the file while we are working to get a realtime effect. But we have not found a way to get this done.

Somebody has some suggestions?

Nope, thats the way its made, when JS is running, PS is unusable. You cant even have a non modal JS window open.

Damn, that really sucks. That ruins my project. I heared someone talking about simulating threads with javascript. I was hoping that could solve the problem. BUt i guess thats going to fail to.

Thx anyway

they may have been refering to web workers, however that would only be for browsers :frowning: Its ruined many projects, you are not alone