How can I set the focus (e.g. cmd+tab) of an arbitrary application (Java or not) from a Java program, on OSX?
Looking for an answer to this question, I came across this question, but it doesn’t really help for OSX.
EDIT: one possibiltiy seems to be to use something like Quicksilver, and a Robot to send it keypresses with modifiers. I’d prefer something more portable, though, that requires less setup to make changes after it’s compiled….
You should be able to reactivate an already running app using the
opencommand that comes with OS X:(Or some equivalent overload of that function.) This will also open an app if it’s not running yet.