Sign in to follow this  
Followers 0
DMRBC

Annoying Audio

5 posts in this topic

Okay, I am new to this whole thing, seeing as I just downloaded AutoIt roughly 5 minutes ago, so don't be hard on me, lol.

I have this program that runs my audio stuff, so if I want to say balance my speakers on my laptop, I would use this program. Here's my problem though. Every time I plug in a microphone for say, a headset, the program will open up and I have to select that I have put a microphone into the microphone port. This is completely useless, but since it's the software I have to use I must deal with it. I have figured out that I can simply hit the down arrow twice and hit enter to select microphone because it brings up the program and then the selection menu right away.

What I want to do is have the script realize when the sound program opens, wait 2 seconds, send the down arrow keystroke twice, send an enter keystroke, and then close the window. Could someone explain to me how I would do this?

Thanks to all that help!

~ DMRBC

Share this post


Link to post
Share on other sites



looks like you are looking for something like winwait("app name given by au3info")... sleep(2000)... send("{down}")...send("{down}")...send("{enter}"). I would write out the script but I have been told about the whole "give a man a fish" speech. If you need more help PM me and I will repost, since I dont tend to recheck posts.

Good luck

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Just thought I'd mention I've made some progress. The keystrokes for whatever reason won't do. I got the down keystroke twice to work fine, but the program itself wouldn't accept the enter keystroke, even though if I do it myself it does accept it. Here's what I came up with instead, and this is based solely on the sizing of my laptop screen and where the program window pops up.

WinWait ("the program title")
Sleep (2000)
MouseMove (1097,486)
Sleep (1000)
MouseClick ( "LEFT" , 1097, 486)
Sleep (1000)
WinClose ("the program title")

Granted I probably don't need the sleeps in between MouseMove and MouseClick, and I could have probably just done it with MouseClick, but I wanted to see it do the job. I may just take MouseMove out. All that's left to do is actually close the program. I can close the window with this but I still have that tab at the bottom. Just need to search for the function. :blink:

Edit: I may just do another MouseClick. I find it odd that WinClose just closes the window but doesn't exit the program completely.

Edited by DMRBC

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Actually you don't even need both the mouse move and mouse click. mouseclick will move the mouse to the position and click in one go.

*edit*

using the windows info tool supplied with autoit, you could probably use controlclick for more accuracy and processclose to completely exit the program.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

And you can also set the mouseclick to a speed of 0 to make it instant. So your code could be reduced to...

WinWait ("the program title")
Sleep (1000)
MouseClick ( "LEFT" , 1097, 486, 0)
Sleep (1000)
WinClose ("the program title")

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
Sign in to follow this  
Followers 0