且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AppleScript的 - 控制点击

更新时间:2023-12-06 12:54:40


  • 大多数从上下文菜单中你可以使用菜单栏(文件,编辑等)做动作。它可以简化您的工作。

  • 要打开特定的GUI元素上下文菜单中,你应该告诉执行操作
    AXShowMenu
    该元素。您可以使用辅助Inspector应用程序,找出GUI元素的层次结构。看看这个讨论

  • 您可以尝试一下鼠标键。看看详情此线程。需要注意的是鼠标键设置为系统preferences - >辅助功能 - >鼠标放;触控板,在山狮

  • 对于取景器脚本 AppleScript的搜索指南可以有很大帮助。

  • Most of the actions from contextual menu you can do using menu bar (File, Edit, etc.). It can simplify your job.
  • To open contextual menu for particular GUI element you should tell to perform action "AXShowMenu" to that element. You can use Accessibility Inspector application to find out the GUI elements hierarchy. Take a look at this discussion.
  • You can try mouse keys. Take a look at this thread for details. Note that "Mouse Keys" settings is in the "System Preferences" -> "Accessibility" -> "Mouse & Trackpad" in Mountain Lion.
  • For finder scripting AppleScript Finder Guide can be of much help.