AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with IfWinActive inside a Loop

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
JimboSlice
Guest





PostPosted: Sat Jul 05, 2008 8:01 pm    Post subject: Problem with IfWinActive inside a Loop Reply with quote

Here is what I got

Code:

Loop {
IfWinActive, Google - Mozilla Firefox
{
   break
}
else
{   
   Send {TAB}
   Send {Enter}
   Send ^w
}
}   
   
ExitApp   



I'm on a site with a bunch of links placed in text format (browseable by using TAB and pressing Enter) and I want the Script to close Firefox and stop working when it finds the link that takes it to the site titled Google.

When it comes across the site titled Google the script will just keep doing the ELSE actions.

This has me puzzled, been trying for hours, help will be very appreciated, thanks in advance!
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 290
Location: Canada

PostPosted: Sun Jul 06, 2008 3:03 am    Post subject: Reply with quote

after ifwinexist put exit app

Code:

Loop {
IfWinActive, Google - Mozilla Firefox
{
   ExitApp
}
else
{   
   Send {TAB}
   Send {Enter}
   Send ^w
}
}   
   
ExitApp   

Or if you watn teh script to run all the time...

Loop {
IfWinActive, Google - Mozilla Firefox
{
   break
   Return,  ; stops next action
}
else
{   
   Send {TAB}
   Send {Enter}
   Send ^w
}
}   
   
ExitApp   

_________________
http://www.spider-games77.piczo.com
Join the Elite few...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
GodlyMario



Joined: 02 Jul 2008
Posts: 35

PostPosted: Sun Jul 06, 2008 3:06 am    Post subject: Reply with quote

ifwinactive only works if the window title bar of firefox is entitled
"Google - Mozilla Firefox", if tabbing and selecting the text link entitles the window so, then its fine, but if it doesnt, you need to find another solution to retrieve text

Code:
Loop {
IfWinActive, Google - Mozilla Firefox
break
else
continue

Send {TAB}
Send {Enter}
Send ^w
}   
exitapp
return
Back to top
View user's profile Send private message
JimboSlice
Guest





PostPosted: Sun Jul 06, 2008 5:41 pm    Post subject: Reply with quote

Thanks a lot guys, got it working. >:)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group