#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("form", 300, 700)
$Button1 =GUICtrlCreateButton("源文件[F1]", 32, 180, 80, 40, 0)
$chuangkou = ("百度一下") ;窗口目标
$lcw = ("另存为")
HotKeySet("{F1}","yuanwenj")
GUISetState(@SW_SHOW); 显示对话框窗口
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg=$Button1
yuanwenj()
EndSelect
WEnd
Func yuanwenj()
Opt("MouseCoordMode", 2);激活窗口客户区的相对坐标
WinActivate($chuangkou);最多等待3秒,3秒后不管如何,脚本继续
If WinActive($chuangkou) Then
Sleep(200)
MouseClick("right",125,630,1,1)
Sleep(200)
send("v")
WinWaitActive("[CLASS:Notepad]","", 3)
If WinActive("[CLASS:Notepad]") Then
Sleep(400)
Send("!f")
Sleep(400)
Send("a")
EndIf
WinWaitActive($lcw,"",3)
If WinActive($lcw) Then
Sleep(400)
ControlSetText($lcw, "", "[CLASS:Edit; INSTANCE:1]", "源文件",1) ;保存的txt名称
ControlClick($lcw,"","[CLASS:Combox; INSTANCE:3]","left",2) ;选择txt格式
ControlClick($lcw,"","[CLASS:Button; INSTANCE:2]","left",1) ;点击确定按钮
ControlClick($lcw,"","[CLASS:Button; INSTANCE:1]","left",1) ;是否替换选择是
Send("!{f4}")
EndIf
Else
MsgBox(4096,"错误", "请登录", 5)
EndIf
Sleep(400)
EndFunc
这段是我完善了部分的代码,不过还是没办法。
MouseClick("right",10,309,1,1)有时会点击在网页的图片上就没办法了。 |