applescript to open/close an app

来源:互联网 发布:淘宝都是假货吗 编辑:程序博客网 时间:2024/04/20 20:05

tell application "System Events"

  get name of every process whose name is "Calculator"

 

  if result is not {} then

 

       tell application "Calculator"

            quit

       end tell


  else


       tell application "Calculator"

            activate

        end tell

  end if

 

end tell

0 0
原创粉丝点击