AppleScript常用案例

Posted 极致极简

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AppleScript常用案例相关的知识,希望对你有一定的参考价值。

  1. AppleScript 截取当前窗口脚本
tell application "System Events"
  key down command
  keystroke "$"
  key up command
  keystroke space
  keystroke (ASCII character 53)
end tell
  1. 最小化窗口(不兼容Chrome浏览器)
tell application "Safari" to set miniaturized of every window to true
  1. 点击最小化
tell application "System Events"                                                             
   tell process "Google Chrome"                                                                  
      click button 1 of window 1                                                            
   end tell
end tell
  1. 最下化
tell application "Google Chrome"
   reopen -- unminimizes the first minimized window or makes a new default window
   activate -- makes the app frontmost
end tell
  1. .

以上是关于AppleScript常用案例的主要内容,如果未能解决你的问题,请参考以下文章