I'm not even sure if bash is the most proper way to achieve this but, I need to, programmatically, switch between opened applications on OS X.
I'm thinking about doing a bash program to execute "cmd+tab".
I'm unable to find this on a regular search, so, perhaps someone can point me some directions here?
You can use Applescript to achieve this.
To focus on a specific application:
And to emulate an actual Cmd+Tab input:
Applescript files (*.scpt) can be run through the command line with
osascript file.scpt.