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
Replies
although I have not yet been experimenting with communication between MS and JS or html through ports/ sockets or with the help of additional tools - I was able to communicate more or less with an embedded html / JS within max.
it requires though that the html or JS file that is used is run within max - which might make it unattractive for you.
so on the maxscript side I used this (stripped down version):
and the html file was: in my case I used Flash as middleware and called the toMaxScript method each time I wanted to send maxscript commands to maxscript and execute them there.
Right now communicating back is not yet solved (sending from max back to the html/JS/flash but there are workarounds for that like writing to the disc or some other things.
before I confuse you perhaps even more, before I used the above example it worked perfectly for me using ActiveX within 3dsmax to embed flash movies and communicate back and forth between the 2. However microsoft stopped activeX support for their newer operation systems (64 bit anyway, and Vista + win7 as well) - so thats not available for 64 bit operation systems anymore.
Which is why I was forced to work with a dotNet control (the System.Windows.Forms.WebBrowser) and try to work my way through that even though documentation and examples for that are very rare.
another way of communicating between Photoshop (cs4+) and 3dsmax might be using flash and their local connection ability:
http://www.flashwonderland.com/communication-between-flash-movies.html
because the way you call commands booth in Photoshop and Max is similar using the navigateToURL (as3, in as1+2 it was getURL(...)), e.g:
v
with the ability in PS cs4 to embed custom panels using the SWF format you could use Flash as the communicator between the 2 applications and still execute javascript on the PS side.