SetControlDelay,100
SetKeyDelay,40
SetWinDelay,500
SetTitleMatchMode RegEx
DetectHiddenText, On
#SingleInstance Ignore
if WinExist("SAP Logon 7\d0") ;正则匹配SAP系统7.N0版本
gosub, MainLablel
else if Not WinExist("SAP Logon 7\d0")
Run ,saplogon.exe
WinWaitActive, SAP Logon 7\d0
MainLablel:
{
#IfWinExist, SAP Logon 7\d0
ControlGetFocus, clsnn, ahk_class SysListView32
ControlSend, %clsnn%, {Enter}, SAP Logon 7\d0
;SysListView32控件不能继续选中里面的子选项(登录系统已经不是控件了),这里我只能选中第一个登录入口,不知道有无大神能解决这个堵点
#IfWinExist
WinWaitActive, SAP ahk_class SAP_FRONTEND_SESSION
#IfWinExist, SAP ahk_class SAP_FRONTEND_SESSION
WinActivate, SAP ahk_class SAP_FRONTEND_SESSION
ControlGetFocus, clsnn, ahk_class SAP_FRONTEND_SESSION
ControlSend, %clsnn%, LanFu{Tab}{ShiftDown}a{ShiftUp}dg13579{U+23}{Enter}
;登录账号和密码,这里面涉及大小写的话需要加入{ShiftDown};有特殊字符例如@,需要用Unicode代码转义{U+23}
#IfWinExist
}
我也写了一个简单的
1