I need a script to open an app if it’s not the frontmost app and hide(command+h) it when it is the frontmost app.
how to write this in Applescript or shell script?
Here is some info I can get:
osascript -e 'tell application "System Events" to get name of application processes whose frontmost is true and visible is true'
open -a 'Kim.app'
osascript -e 'tell application "System Events" to set visible of process "Kim" to false'
still don’t know how to write this