【问题标题】:applescript click missing valueapplescript单击缺失值
【发布时间】:2016-12-03 15:40:44
【问题描述】:
tell application "Google Chrome" to activate
delay 0.5
tell application "System Events"
    tell process "Google Chrome"
        click at {1067, 79}
        click at {1026, 220}
    end tell
end tell

这是我的applescript,我尝试打开和扩展,首先单击chrome,然后第二次单击以下载扩展内的视频,但是,只执行了第一个命令,第二个返回“缺失值”。我不知道为什么。我也尝试在两个命令之间添加延迟,它仍然不起作用。有谁可以帮忙?

【问题讨论】:

    标签: applescript


    【解决方案1】:
    tell application "Google Chrome" to activate
    delay 0.5
    tell application "System Events"
        tell process "Google Chrome"
            click at {1067, 79}
    delay 1
            click at {1026, 220}
        end tell
    end tell
    

    如果这是你的意思^那么试试这个:

    tell application "Google Chrome" to activate
    delay 0.5
    tell application "System Events"
        tell process "Google Chrome"
            click at {1067, 79}
        end tell
    end tell
    delay 0.5
    tell application "Google Chrome" to activate
    tell application "System Events"
        tell process "Google Chrome"
            click at {1026, 220}
        end tell
    end tell
    

    【讨论】:

      【解决方案2】:

      事实证明,如果它“无法点击”,它将返回给定坐标的“缺失值”。

      这似乎发生在我点击 Chrome 浏览器时。如果我点击进入 Safari,效果很好。如果我点击火狐,它会返回并说它点击了,但实际上并没有在浏览器中做任何事情。很奇怪。

      解决方法:改为使用第 3 方应用程序 MouseTools 来单击。参考:

      https://stackoverflow.com/a/12887429/32453

      https://stackoverflow.com/a/22595044/32453

      虽然我想你也可以编写自己的 obj-c 代码来完成它,等等。

      【讨论】:

        猜你喜欢
        • 2016-09-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-21
        • 1970-01-01
        • 2021-11-25
        相关资源
        最近更新 更多