Jump to content

Recommended Posts

Posted

Hi guys i'm studying this great program and it's code but i can't do something. I want to click or send space when button with text:Skip will appear, i wan't a loop that will be checking on for 10 sec is button skip does exist. I've made this code but it's doesn't work ;S

HotKeySet( "{F3}", "exitthescript")
WinActivate ( "[TITLE:Recovery Manager]", "")
Local $text = ControlGetText("[TITLE:Recovery Manager]", "","[CLASS:Button; TEXT:Skip; INSTANCE:3]")
While @error="1"
  $text = ControlGetText("[TITLE:Recovery Manager]", "","[CLASS:Button; TEXT:Skip; INSTANCE:3]")
  Sleep(60000)
WEnd
Sleep(3000)
Send("{SPACE}")
Func exitthescript()
     Exit
EndFunc

I hope you cant help with that. :)

Posted

I like to validate that a control exists, isvisible, and enabled, prior to clicking, or performing an action...just create a UDF that loops until those conditions are met..sometimes, the controls may take a bit to enable, which will cause issues in your script

ControlCommand ( $hwndCallersWindow, "", $hwndCallersControl, "IsEnabled", "" )

ControlCommand ( $hwndCallersWindow, "", $hwndCallersControl, "IsVisible", "")

i do the same kind of checks on windows as well, but using wingetstate()

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...