Jump to content

ControlCommand Function


 Share

Recommended Posts

Hi Everyone,

I read the description of the command in the online documentation section and I could not get it to work. Maybe I don't understand?

So I execute a .exe file. It takes about 3 seconds for the program to load up. Once it is loaded, my script already skipped ahead. What I've been trying to do is get the script to recognize that the "Next" button in the program that I'm trying to automate is not active so don't send ("!n") just yet.

How would I achieve that?

This is what I currently have and it's not working. Like I stated above, I may be using the ControlCommand wrong.

If Not WinActive ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard") Then WinActivate ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard")
 WinActive ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard")
 If ControlCommand ("", "&Next >", 1727, "IsEnabled", "") Then Send ("!n")

Any help is greatly appreciated.

Link to comment
Share on other sites

Hi Everyone,

I read the description of the command in the online documentation section and I could not get it to work. Maybe I don't understand?

So I execute a .exe file. It takes about 3 seconds for the program to load up. Once it is loaded, my script already skipped ahead. What I've been trying to do is get the script to recognize that the "Next" button in the program that I'm trying to automate is not active so don't send ("!n") just yet.

How would I achieve that?

This is what I currently have and it's not working. Like I stated above, I may be using the ControlCommand wrong.

If Not WinActive ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard") Then WinActivate ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard")
 WinActive ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard")
 If ControlCommand ("", "&Next >", 1727, "IsEnabled", "") Then Send ("!n")
Link to comment
Share on other sites

I'm a little new, but maybe try this?

; First, wait for the window to show up
WinWait("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard")
; The prior command will block in the script until the window is there
; Now, click our button, but actually click it instead of send()ing
While Not ControlCommand ("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard", 1727, "IsEnabled")
    Sleep(200)
Wend
ControlClick("SecureCRT - InstallShield Wizard", "Welcome to the InstallShield Wizard", 1727)
It works like a champ. Thank you so much for your help. Welcome to this great community by the way, everyone here is very helpful in all aspects. Enjoy your time here. :)
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...