Skip to main content
5 of 5
added 5 characters in body
user956609
  • 405
  • 2
  • 5
  • 12
res=$(osascript -e "tell application \"System Events\" to get name of application processes whose frontmost is true and visible is true");
if [ $res == "Kim" ]
then
    osascript -e "tell application \"System Events\" to set visible of process \"Kim\" to false"
else
    open -a 'Kim.app'
fi

I did it like this, it works but excutes very slow, how to optimize this?

user956609
  • 405
  • 2
  • 5
  • 12