I do not know much about nowaday's Java, I gave up on it with version 1.0 .
You can try to invoke the system's "open" method on the JSX file in question, eventually this will run it, or it will just open in ESTK editor.
Alternatively, you have to find out the glue classes that allow you to tap into the OS specific inter-application communication. On the Mac, that would be AppleEvent, on Windows you'd search a way to load a "TLB" type library. Then you'd feed the script file into the app.doScript method of InDesign.
If you don't find such glue classes, there must be some way to invoke a shell script. On the Mac, the shell script can use the /usr/bin/OSAScript utility (see its man page for details) to send an AppleScript / AppleEvent. Windows must have something similar.
I'm also very much to learn, "How to intract InDesign through java".
So, Please kindly help me to "Java Swing and InDesign / InDesign Java Script"
Thanks & Regrads
Sorry if I did not make this clear:
This is not an InDesign issue but a Java issue. Search, or ask in a Java forum for best practice to deal with the mentioned platform specific mechanisms:
- inter process communication (AppleEvent or TLB/OLE )
- command line / shell script invokation
- a way to launch an JSX script - the equivalent mechanism to File.execute() in Extendscript.
For example, if I ask Google for "Java TLB", the second hit takes me to:
Eventually you can reuse the DLL and jar - I haven't read that far.
Google for Java AppleEvent:
Note the 1999 copyright, this is pre-OSX. Also located in a "legacy documents" area. Apple has the bad habit to deprecate/abandon most of their technology every other year, so I would not be surprised if it does not work any more and you'd have to write you own JNI, JDirect or JNIDirect glue ( I don't even know the current buzzword). Ah, further digging unveiled that they even dropped the successor which was named "CocoaJava".
If Mac specific, maybe post your questions to this list: http://lists.apple.com/mailman/listinfo/java-dev
Following up, I just found this quote:
If all you want to do is execute scripts, I suggest using the command 'osascript' and System.exec(String). See 'man osascript' in Terminal for the command's details.Dirk
i want to this one in winxp.
1 person found this helpful
System.exec sounded like cross platform. Since that quoted 2004 recommendation, it must've been moved though, no System.exec any more.
Instead, this one appears promising
Now you have to invoke anything that can talk to InDesign.