Sign in to follow this  
Followers 0
Arclite86

How To Focus On Browser Window (The Right Way)

8 posts in this topic

#1 ·  Posted (edited)

I know this is a basic question

but im trying to focus on a firefox window with WinActivate and WinGetHandle

The url = http://tweepi.com/tools/flush#0

the tabname = Flush the Twitter users that do not follow you back :: Tweepi

but somehow Im doing something wrong because after the function I give the browser window a command and it give me an error that it didn'' found the browser window

So I would really like to know how I focus this window In the right way.

Edited by Arclite86

Share this post


Link to post
Share on other sites



Your question in vague. Please explain why you are using WinActivate / WinGetHandle instead of one of the commands from FF.au3.

Also, what additional commands are you sending to the browser? Be specific. Post some example code that demonstrates the issues.

Share this post


Link to post
Share on other sites

Well its actually pretty simple

When I go from page to page I use _FFOpenURL("http://website.com/example") it suddently loses focus  and after that all commants will give errors

If somebody could help me with something like: If error that "focus on firefox window"

but I dont know how I can do this in the correct way

Share this post


Link to post
Share on other sites

If it was  simple, you would have already come up with a solution. :rolleyes:

If you want help, post a working script that:

1) demonstrates the issues you are having, and ;

2) uses a publicly available website (not Tweepi) so that others can run actually run the code.

Share this post


Link to post
Share on other sites

This is an example when it loses it focused 

(Tweepi is the only website I use)

_FFOpenURL("http://tweepi.com/tools/flush#480")
_FFLoadWait()
$oButton2 = _FFXPath("//input [@id='button78']")
_FFClick($oButton2)
_FFLoadWait()
Sleep(2000)
_FFOpenURL("http://tweepi.com/tools/flush#500")
_FFLoadWait()
$oButton2 = _FFXPath("//input [@id='button78']")
_FFClick($oButton2)
_FFLoadWait() 

its very hard to track and see where the problem is because 9 out of 10 it works fine

but something it just loses it focus :wacko:  its very weird so thats why I thought of using a code like If error that "focus on firefox window"

Share this post


Link to post
Share on other sites

Are you doing anything while this script runs? Clicking on another window?

yes is do sometimes I use google chrome at the same time, could that effect it? and how can I prevent I cant I use chrome at the same time?

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