AppleScript的 - 控制点击 [英] applescript - control click

查看:4568
本文介绍了AppleScript的 - 控制点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何控制与点击AppleScript的?

How can I control click with AppleScript?

本脚本应该工作,但它并不

This script should work, but it doesn't

activate application "Finder"
tell application "System Events"
    tell process "Finder"
        key down control
        delay 1
        click at {600, 600} -- {from left, from top}
        delay 1
        key up control
    end tell
end tell

MouseTools有时不可靠的。我知道cliclick的 - 还没有尝试过。

MouseTools is sometimes unreliable. I know of cliclick — still haven't tried it.

我preFER一个AS唯一的解决方法,但欢迎任何建议。

I'd prefer an AS only workaround but welcome any suggestions.

推荐答案


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

  • 要打开特定的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.
  • 这篇关于AppleScript的 - 控制点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆