Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Winset, Bottom - Need help sending window to bottom of stack


  • Please log in to reply
3 replies to this topic
JohnS
  • Members
  • 3 posts
  • Last active: Jan 23 2013 11:05 AM
  • Joined: 20 Jan 2013

I have a script that is constantly tabbing through a series of google chrome windows. Every now and then i'll get a popup that goes to the top of my window stack and therefore screwing my alt-tabbing. 

 

I'm trying to have my script check the tittle of the window( before doing any of the clicking), and if not a google chrome window, send it to the bottom of the stack by winset, bottom

 

so far no dice, this is the best i have:

 

I did succeed in closing two specific annoying popups, as you can see them listed before the google chrome tittle check. 

At this point, when it gets to
IfWinNotExist, Google Chrome

it just sends that actual google chrome window or whatever it may be, to the bottom of the window stack 

 

 

SetKeyDelay, 500
ScreeClick:
CoordMode, Mouse, Screen ;
WindowClick:
CoordMode, Mouse, Screen ;
^!p::Pause


$F12::
Loop 
{




Send, {ALT DOWN}{TAB}{TAB}{TAB}{ALT UP}
Sleep, 100


IfWinExist, Optional update delivery is not working
{
WinClose ; 
}


IfWinExist, Apple Software Update
{
WinClose ; 
}


IfWinNotExist, Google Chrome
{
WinActivate
WinSet, Bottom,, ;
return
}
else
Sleep, 500
Click, left,  178,  60 , 5
Sleep, 103
Click, left,  155,  57 , 5
Sleep, 95
Click, left,  170,  59 , 2
Sleep, 110
Click, left,  65,  62 , 2
Sleep, 100


}
Return


smorgasboard
  • Members
  • 660 posts
  • Last active: Jan 14 2016 08:53 AM
  • Joined: 18 Jul 2012
replace your winset line by
id := WinExist("A")
WinSet, Bottom,, %id%

JohnS
  • Members
  • 3 posts
  • Last active: Jan 23 2013 11:05 AM
  • Joined: 20 Jan 2013

That might help me with something else, but for this it doesn't since it just minimizes the 2 topmost windows in the stack. 

 

Thank you very much for trying to help! 



JohnS
  • Members
  • 3 posts
  • Last active: Jan 23 2013 11:05 AM
  • Joined: 20 Jan 2013

I got it to work! all credit goes to everyone who helped me in chat and in here! I love the AHK community !

This is how my code ended up: 

 

 

SetKeyDelay, 50
ScreeClick:
CoordMode, Mouse, Screen ;
WindowClick:
CoordMode, Mouse, Screen ;
^!p::Pause
$F12::
Loop 
{
Send, {ALT DOWN}{TAB}{TAB}{TAB}{ALT UP}
Sleep, 100
IfWinExist, Optional update delivery is not working
{
WinClose ; 
}
IfWinExist, Apple Software Update
{
WinClose ; 
}
IfWinActive, Google Chrome
{
Click, left,  178,  60 , 5
Sleep, 103
Click, left,  155,  57 , 5
Sleep, 177
Click, left,  170,  59 , 2
Sleep, 198
Click, left,  65,  62 , 2
Sleep, 100
}
else
{
WinSet, Bottom,,A
}
}
Return

The Main big help was using: IfWinActive,  vs IfWinNotExist

Thanks again!