TMoney777

Newb question ALT+TAB

6 posts in this topic

Hi new to autoit been able to get my script to press 0 at intervals but now I want to have it do so on alternating programs. Got a script looking like this.

Send ("0")
Sleep ("27000")
Send ("{Alt down}")
Sleep ("1000")
Send ("{TAB}")
Sleep ("1000")
Send ("{Alt up}")
Sleep ("1000")
Send ("0")
Sleep ("27000")
Send ("{Alt down}")
Sleep ("1000")
Send ("{TAB}")
Sleep ("1000")
Send ("{Alt up}")
Sleep ("1000")

Presses 0 then holds down Alt for a couple seconds but does not actually press tab. 

Share this post


Link to post
Share on other sites



Using these keys for some reasons may make your scripts quite messy. What are you trying to achieve? May be there is a more reliable way to do that....

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah I don't know what you're doing but I'd use a WinActivate($win_title) to switch window focus.

example:

WinActivate("readme.txt - Notepad"); Where 'readme.txt - Notepad' equals the title string of the window you want to focus.

Edited by Xandy

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Trying to switch between 2 running files of the same video games and have it do the same task over and over on both.

Share this post


Link to post
Share on other sites

I could probably also just do it with mouse clicks but am having a tough time figuring that one out too.

Share this post


Link to post
Share on other sites

Cancel that managed to figure out the mouse thing. =) Working now.

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