I'm designing a little software in Java. I don't know the term/definition to what I'm doing, but I'm prompting commands from Java to the terminal. Something like this:
Process process = Runtime.getRuntime().exec("command");
I've done this before in Linux, and I used gksudo
for commands that required the root password.
Is there any gksudo
in OS X? Any graphical popup asking for root password?
Following ZJR's answer, I've made this into automator, so you can use it as a Service or whatever:
Or, maybe you just think his answer is outdated and still want an AppleScript, just write this single line in Script Editor:
Which you can then make into an app and use it as a Service or whatever.