gpt4 book ai didi

autoit - 如何使用 AutoIt 在文本框中输入值?

转载 作者:行者123 更新时间:2023-12-02 17:48:29 26 4
gpt4 key购买 nike

我有两个文本框和一个按钮。如何在文本框中输入一个值,然后使用 AutoItEnter 按钮?

最佳答案

举个例子就这么简单:

$gui = GUICreate("Test GUI", 640, 280)
$input = GUICtrlCreateInput("Input field", 10, 10, 620, 20)
$edit = GUICtrlCreateEdit("Edit Control with Text", 10, 40, 620, 200)
$button = GUICtrlCreateButton("Button", 10, 250, 620, 20)

GUISetState(@SW_SHOW)

Sleep(2000)

ControlSetText("Test GUI", "", $input, "New text for the input")
ControlSetText("Test GUI", "", $edit, "New text for the edit... with some bla bla bla...")
Sleep(500)
ControlClick("Test GUI", "", $button)
Sleep(500)
ControlFocus("Test GUI", "", $input)

Sleep(4000)

ControlSetText("Test GUI", "", "[CLASS:Edit; INSTANCE:1]", "New text for the input, referenced as Edit1")
ControlSetText("Test GUI", "", "[CLASS:Edit; INSTANCE:2]", "New text for the edit..., referenced as Edit2 with some bla bla bla...")
Sleep(500)
ControlClick("Test GUI", "", "[CLASS:Button; INSTANCE:1]")
Sleep(500)
ControlFocus("Test GUI", "", $input)

Sleep(4000)

此外,你的英语还不是很清楚,你应该在问题上多下点功夫;-)

如果你想知道你必须使用什么 "[CLASS:Edit; INSTANCE:1]",试试“AutoIt v3 Window Info”tool .并开始阅读一些非常好的文档。祝你好运!

关于autoit - 如何使用 AutoIt 在文本框中输入值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11671106/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com