1 Reply Latest reply on Dec 7, 2012 12:00 PM by Tomas_Mirezko

    How to start Flash from Java on Mac OS X?

    Tomas_Mirezko Level 1

      I am creating a cross platform script in Java that will start Flash and execute some JSFL scripts.

       

      I found this article http://www.mikechambers.com/blog/2004/02/20/executing-jsfl-from-the-command-line-on-os-x/

       

      Works from command line

      osascript -e 'tell application "Flash" to open posix file "/var/...tmp/sample.jsfl"'

       

      Does not work from Java, like this:

      String flashExe = "Flash";

      String jsflFile = "/var/...tmp/sample.jsfl";

       

      MessageFormat osascriptFormat = new MessageFormat("''tell application \"{0}\" to open posix file \"{1}\"''"); String osascript = osascriptFormat.format(new Object[]{flashExe, jsflFile}); String[] commands = new String[]{"osascript", "-e", osascript}; ProcessBuilder pb = new ProcessBuilder(commands); pb.start();

       

      So my question is: How to start Flash from Java on Mac OS X?