Jump to content

Probably yet another noob question


Recommended Posts

Ok, sorry for so many newb questions. I'm wondering how you have autoit press buttons for you defined on the screen, not keyboard buttons. For example I'm trying to automate adjusting settings on pc's that I'm tasked to setup, and I'd rather automate the process with the parameters our team has agreed on.

OK, so I'm trying to disable the language bar on the Windows Task bar and I've gotten all this code (see below), but I want the script to press the 'OK' button which doesn't have an ALT+O (i.e. Send("!O")) option, and according to the 'AutoIt Window Info' program, its "Button9". In my script below I have what I've written before sending this out to the forums, in black. I have what I'd like the script to do in red, but I don't know the code for it, so that's where I need help.

***Begin Code***

run("rundll32.exe shell32.dll,Control_RunDLL intl.cpl")

WinWaitActive("Regional and Language Options","")

If Not WinActive("Regional and Language Options","") Then WinActivate("Regional and Language Options","")

WinWaitActive("Regional and Language Options","")

Send("^{TAB}")

Send("!D")

WinWaitActive("Text Services and Input Languages","")

If Not WinActive("Text Services and Input Languages","") Then WinActivate("Text Services and Input Languages","")

WinWaitActive("Text Services and Input Languages","")

Send("!B")

WinWaitActive("Language Bar Settings","")

If Not WinActive("Language Bar Settings","") Then WinActivate("Language Bar Settings","")

WinWaitActive("Language Bar Settings","")

If ControlCommand("Language Bar Settings","","Button2","IsChecked","") Then

Send("!D")

EndIf

;This is the equivalent of pressing the 'OK' button at the bottom of the window.

Send/PRESS("BUTTON9")

WinWaitActive("Text Services and Input Languages","")

If Not WinActive("Text Services and Input Languages","") Then WinActivate("Text Services and Input Languages","")

WinWaitActive("Text Services and Input Languages","")

;This is the equivalent of pressing the 'OK' button at the bottom of the window.

Send/PRESS("BUTTONX")

WinWaitActive("Regional and Language Options","")

If Not WinActive("Regional and Language Options","") Then WinActivate("Regional and Language Options","")

WinWaitActive("Regional and Language Options","")

;This is the equivalent of pressing the 'OK' button at the bottom of the window.

Send/PRESS("BUTTON3")

***End code***

Can anyone help?

TIA

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...