Sign in to follow this  
Followers 0
Fatty

Please Help: How to reactivate a window that the title has changed?

6 posts in this topic

What I would like to achieve is activating a twitter page that is already open and then switching over to a facebook page that is already open and then back to the open twitter page. The problem I am having is that the title on the twitter page changes with the corresponding new tweets it receives and it won't reactivate. I thought Opt("WinTitleMatchMode",2) would do what I need but maybe I am doing it wrong.

Please excuse me if this is basic but I appreciate everyone's reply and willingness to help me.

Opt("WinTitleMatchMode",2)
_WinWaitActivate("Nintendo of America (NintendoAmerica) on Twitter - Windows Internet Explorer","")
Send("{F5}")
Sleep(5000)

_WinWaitActivate("Nintendo | Facebook - Windows Internet Explorer","")
Send("{F5}")
Sleep(5000)


_WinWaitActivate("(2) Nintendo of America (NintendoAmerica) on Twitter - Windows Internet Explorer","")
Send("{F5}")
Sleep(5000)

Share this post


Link to post
Share on other sites



Grab the window handle before doing anything. The title may change, but the handle will not.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Here is what I tried but still no luck. Am I doing this wrong Mechaflash? The results I get are activating the facebook page, waiting 2 seconds and then activating the twitter page and then 2 more seconds after that it just flashes on the existing twitter page without actually changing back over to the facebook page. I am also curious on if the twitter page activates once a new tweet shows up and changes the title. I am waiting on a new tweet to test that functionality.

$fFlag = True
$FacebookHandle = WinGetHandle("Nintendo | Facebook - Windows Internet Explorer","")
$TwitterHandle = WinGetHandle("Nintendo of America (NintendoAmerica) on Twitter - Windows Internet Explorer","")


While $fFlag = True



WinActivate($FacebookHandle,"")
Sleep(2000)



WinActivate($TwitterHandle,"")
Sleep(2000)

WEnd

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

you don't have any error handling to make sure that the handle was found. Also, are these tabs, or are they their own browsers?

Do something like this for each handle:

If Not IsHwnd(yourhandle) Then msgbox(1,1,"not able to find window")

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Another option is to use _IEAttach to have multiple objects that you manipulate.

Share this post


Link to post
Share on other sites

I added the error handling and found out that when I start the script I have it doesn't work if I have either of those handles already activated. I opened up another tab to google and then started the script and it worked like I wanted it to. Not sure why I have to select another tab before executing but somehow that did the trick. Now if I can figure out why the other tab is necessary. I guess I could leave it in there and never activate the window but that is just a workaround rather than a fix. Thank you everyone for your help on this.

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