AppleScript填写文本字段

4

我尝试填写文本框,但无法成功。

activate application "****"
tell application "System Events"
    tell process "****"
        tell text field 1 of window 1
            set value of text field 1 to "here is the text"
        end tell
    end tell
end tell

我实际上用延迟3秒的方式解决了它 点击窗口1的文本字段1 延迟3秒 键入“***”,但并不总是有效。 - Kevin
文本框1的第二个是太多了。只需将值设置为“这里是文本”。 - user309603
脚本实际上可以通过这个,但实际文本字段中没有填充任何内容。 激活应用程序“” 告诉应用程序“系统事件” 告诉进程“” 延迟1秒 选择窗口1的文本字段1 将值设置为“***” 延迟2秒 结束告诉 - Kevin
1个回答

5
activate application "****"
tell application "System Events"
    tell process "****"
        set value of text field 1 of window 1 to "here is the text"
    end tell
end tell

如果你想尝试,这对我来说有效。

“text field 1” 是针对应用程序中的第一个文本字段吗?如果是,我尝试过了,但对我不起作用。 - Ahmad

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接