This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This code, does not find the AppleScript engine. - Isn't this engine part of the Java 7 now? String script = "osascript -e tell app \"Outlook\" to launch"; String sayOutlook = "say -v vicky \"Starting Outlook\""; ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine engine = mgr.getEngineByName( "AppleScript" ); if( engine == null ) { System.err.println( "AppleScript engine not found." ); } else { try { engine.eval( sayOutlook ); } catch( ScriptException ex ) { String msg = ex.toString(); String x = ""; } catch( Exception ex ) { String msg = ex.toString(); String x = ""; } }
I don't have a Mac to try it but this doesn't look like related to JavaScript, reassigning to to Java/project (please reassign to proper component if I'm wrong, thank you).
Nothing to do with java project. >This code, does not find the AppleScript engine. >- Isn't this engine part of the Java 7 now? In fact it's even more complicated. The original AppleScript engine was done by Apple as an extension of Apple's JDK, it was placed in the /System/Library/Java/Extensions/. However the folder was removed by an MacOS X (XCode) update. This was the bad part. Now the "good part". The AppleScript engine is bundled as a part of Oracle JDK 7 (in rt.jar the apple.applescript) however it's renamed and not registered. So you need to do following things to get your program running: 1) change ScriptEngine engine = mgr.getEngineByName( "AppleScript" ); to ScriptEngine engine = mgr.getEngineByName( "AppleScriptEngine" ); 2) register the AppleScript engine factory. Even it's in rt.jar it's not registered, so you need to register it in your jar (application). You need to create folder: "META-INF/services" in your source root, in it create a file "javax.script.ScriptEngineFactory" and paste following line into it: apple.applescript.AppleScriptEngineFactory This causes that the AppleScriptEngineFactory will be found by ServiceLoader. 3) Clean and build your project and the application should run.