日期:2014-05-20 浏览次数:20781 次
import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class Test { public static void main( String[] args ) throws ScriptException { ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine engine = mgr.getEngineByName("AppleScript"); engine.eval( "tell application \"iTunes\" to play" ); } }