从Script / osx 10.7+ / safari / automator / objective-c中删除Modal

时间:2013-07-06 05:08:18

标签: c++ objective-c safari applescript osx-lion

我正在尝试将焦点放在Safari浏览器模式框中并控制其输入和解雇。

示例:导航到一个网站,它会抛出一个模态框,是否可以创建一个自动化工作流程或脚本,以便能够提供模态焦点并与其内容进行交互?

TIA,

BK

1 个答案:

答案 0 :(得分:0)

尝试使用系统事件:

tell application "System Events" to tell process "Safari"
    click button "OK" of window 1
end tell
tell application "System Events" to tell process "Safari"
    set value of text field 1 of window 1 to "aa"
    click button "OK" of window 1
end tell