Jump to content
Sign in to follow this  
Wodahskcin

Switching windows

Recommended Posts

Wodahskcin

Alright so, seeing as I humiliated myself with my last post, I"ll make a new one. I"m just looking for a little bit of help when it comes to switching windows.

Heres what I"m trying to set up.

A script that will capture the name of the active window, switch to another program, then switch back to the active window.

But if the active window is windows media player, then i want the mouse to double click (to make the movie full screen)

Heres what I got so far.

while 1
;This is at the top of the script
$window1 = WinGetTitle("")
;Then this is the code I have to switch to the last active window (window1), and if the window name is equal to 'Windows Media Player' to double click.
WinActivate($window1,"")
if $window1 = "Windows Media Player" then
MouseClick("left",581,474,1)
MouseClick("left",581,474,1)
Else    
EndIf

;And then after the if statement I need the while loop to continue right after the if statement.
wend

It seems to work alright, except it doesnt double click when its WMP, but the switching to the last active window works.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.