I have a couple of AppleScripts that i want to run from Java. I have several options including:
((new ScriptEngineManager()).getEngineByName("AppleScript")).eval(scriptString))
)Desktop.getDesktop().open("name.app")
)Those two seemed the best options to me and I was wondering
Not sure I would go with 2, that seems like a very big hammer.
The other old style solution was to exec 'osascript' command.
As far as I know using the script engine support is the preferred method.
Your first option sounds right to me, but if for some reason you want to run it as an external script, you could consider running an osascript the same way you would run a shell script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With