|
如题,脚本里面如何退出当前的ACTION啊
我想做个判断,如果当前的OBJECT 不存在的话就等待比如说5分钟,时间到自动退出当前ACTION,而不再抛出说找不到OBJECT 啥的
Dim DialogWin
Window("Notepad").Activate
Set DialogWin = Window("Notepad").Dialog("Font")
'DialogWin.WinButton("OK").Click
If Not DialogWin.Exist(1) Then
Call TimeIt(5)
End If
If DialogWin.Exist(1) Then
DialogWin.WinButton("OK").Click
else
Msgbox "Error Close PLS"
' I want exit from here
End If
i=1/0
Msgbox " 1 " & Err.Number & " " & Err.Description
Function TimeIt(N)
Dim StartTime, EndTime,iCnt
StartTime = Timer
For iCnt = 1 To N
wait(1)
Next
EndTime = Timer
TimeIt = EndTime - StartTime
End Function |
|