Jump to content
kenmarold

Clicking OK in a dialog box

Recommended Posts

kenmarold

I know this is probably simple, but I've never used AutoIt before so I'm not having any success with the script I've written. I'm running a program after windows 10 starts up and the first thing it gives me is the dialog box attached. All I need to do is automate the clicking of the OK button. The script I've written isn't working so far :

WinActivate("RoomView Express Login")

If WinActivate("RoomView Express Login") Then
   ControlClick("RoomView Express Login", "", "[CLASS:Button; INSTANCE:3]")
EndIf

Could someone please show me how to correctly do this? I've also attached the AutoIt Window Info of the the button that I'm trying to click. Thank you in advance for your help!

RoomviewScreenshot.jpg

RoomviewInfoScreenshot.jpg

Share this post


Link to post
Share on other sites
Subz

With the Window open, does the following work?

WinActivate("RoomView Express Login")
ControlClick("RoomView Express Login", "", "[CLASS:Button; INSTANCE:3]")

 

Share this post


Link to post
Share on other sites
kenmarold

Hi @Subz. No it does not.

Share this post


Link to post
Share on other sites
kenmarold

@Subz, actually it does seem to partially work though. It brings the Window into focus, but it doesn't click the OK button.

Share this post


Link to post
Share on other sites
Subz

Does it require any input first for example password?  Can you try using "[CLASSNN:Button3]"

Share this post


Link to post
Share on other sites
kenmarold

Like this? 

WinActivate("RoomView Express Login")
ControlClick("RoomView Express Login", "", "[CLASSNN:Button3]")

 

Share this post


Link to post
Share on other sites
Subz

Correct

Share this post


Link to post
Share on other sites
kenmarold

@Subz, still no success.

Share this post


Link to post
Share on other sites
kenmarold

Any other ideas on what might be going on? I'm in a real jam if I can't automate this dialog. Any other insight would be really appreciated.

Share this post


Link to post
Share on other sites
kenmarold

@Subz. It doesn't require a password. If I actually just click the OK button it open the application.

Share this post


Link to post
Share on other sites
Subz

Just checking our systems if we had a copy but we have Crestron AirMedia which uses an xml file to configure.  What I suggest is try Control Click on another button, also if you click Alt key do you see any keyboard shortcuts you can utilise to press OK?

Share this post


Link to post
Share on other sites
kenmarold

@Subz I can send you a copy of Roomview Express to test if that helps. It's a free software.

Share this post


Link to post
Share on other sites
Subz

Sure

Share this post


Link to post
Share on other sites
Subz

Add #RequireAdmin at the top of your script and it should work fine.

Share this post


Link to post
Share on other sites
kenmarold

That did it. Thank you SO MUCH for the help with this!

Share this post


Link to post
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

×