如何在Mac OS X上从Java启动Flash?

如何在Mac OS X上从Java启动Flash?,java,macos,flash,jsfl,Java,Macos,Flash,Jsfl,我正在用Java创建一个跨平台脚本,它将启动Flash并执行一些JSFL脚本 我找到了这篇文章 从命令行工作 osascript -e 'tell application "Flash" to open posix file "/var/...tmp/sample.jsfl"' 不适用于Java,如下所示: String flashExe = "Flash"; String jsflFile = "/var/...tmp/sample.jsfl"; MessageFormat osascri

我正在用Java创建一个跨平台脚本,它将启动Flash并执行一些JSFL脚本

我找到了这篇文章

从命令行工作

osascript -e 'tell application "Flash" to open posix file "/var/...tmp/sample.jsfl"'
不适用于Java,如下所示:

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();

问题是:如何在Mac OS X上从Java启动Flash?

简单。。。本文认为,

String jsflPath = "/var/...tmp/sample.jsfl";    
File jsflFile = new File(jsflPath);
jsflFile.setExecutable(true);
String[] commands = new String[]{"open", jsflFile.getAbsolutePath() };

ProcessBuilder pb = new ProcessBuilder(commands);
pb.start();
String[] commands = new String[]{"open", "-a", "Adobe Flash CS5", jsflFile.getAbsolutePath()};