执行自动化到最后一步,需要手动点击该窗口,才能继续!
本帖最后由 bearpc 于 2010-1-4 09:45 编辑问题:执行自动化到最后一步,如上图,需要手动点击该窗口,才能继续自动化操作,不知有何解决方法?
软件:KMPlayer中文版 2009 Release
AU3代码:Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")
WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")
WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")
WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")
WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")
Sleep(800)
If ProcessExists("iexplore.exe") Then
ProcessClose("iexplore.exe")
EndIf
WinWaitActive($hd,"正在完成")
ControlClick($hd,"","Button4")
ControlClick($hd,"","Button2")下面为正确代码:Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")
WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")
WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")
WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")
WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")
Sleep(800)
If ProcessExists("iexplore.exe") Then
ProcessClose("iexplore.exe")
EndIf
ControlCommand ($hd,"运行 KMPlayer中文版","Button4","UnCheck" )
ControlClick($hd,"","Button2") ProcessClose (WinGetProcess ("安装 - 影音先锋"))
能否搜索一下…
我上午才回复一个相同的问题 ControlCommand ( "title", "text", controlID, "UnCheck" ) 可以用controlclick ("标题","文本","控件ID")
如果只想用键盘的话,试下激活窗口能行不或者你试试用TAB能切换的到不,能切换的到就再加个回车就行了 直接发一个SEND命令也可以 Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")
ProcessWait("iexplore.exe")
ProcessClose("iexplore.exe")
WinWait($hd,"正在完成")
WinActivate($hd,"正在完成")
WinWaitActive($hd,"正在完成")
Send ("{SPACE}")
Send ("!f")试了2次,没出问题! 本帖最后由 bearpc 于 2010-1-4 09:42 编辑
解决方法Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")
WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")
WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")
WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")
WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")
Sleep(800)
If ProcessExists("iexplore.exe") Then
ProcessClose("iexplore.exe")
EndIf
ControlCommand ($hd,"运行 KMPlayer中文版","Button4","UnCheck" )
ControlClick($hd,"","Button2") 试了2次,没出问题!
59123608 发表于 2010-1-4 09:34 http://autoitx.com/images/common/back.gif
方法可以,只是使用键盘过多,出错率高!
ceoguang 发表于 2010-1-4 01:29 http://autoitx.com/images/common/back.gif
谢谢这位仁兄了 弱弱的问,是不是窗口没激活?
少了WinActive 回复 10# Allreal
是的
页:
[1]