Jump to content

Script idea or troublshooting help.


Iceburg
 Share

Recommended Posts

I have a TV that sits in front of our NOC and to protect from burn in I wrote a script that moves the windows around. Sometimes if we have network issues though one of the pages goes into a 404 or page not found and changes the title from what I am looking for. So I did a if exists and then send an F5 to refresh the screen which works great the site comes back up, but the refresh on the page for some reason does not change the title back from page not found to whatever it was before the network down, thus my winmove's do not work on it any more. I am assuming the way to fix this to to move the windows by process ID instead of by title although I am not sure how I do this since they are both IE windows. Can someone shed light on this? Here is my script so far:

While 1;infinate loop

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 0, 0, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 0, 365, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 30, 0, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 50, 370, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 55, 5, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 100, 375, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 80, 10, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 150, 380, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 105, 15, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 200, 385, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 130, 20, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 250, 395, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 155, 25, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 300, 400, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 180, 30, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 350, 405, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 205, 35, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 400, 410, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 230, 40, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 450, 415, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 255, 45, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 500, 420, 410, 429)

Sleep (10000)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 270, 50, 760, 388)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 550, 425, 410, 429)

If WinExists("Cannot find server - Microsoft Internet Explorer") Then

WinActivate("Cannot find server - Microsoft Internet Explorer", "")

Send("{F5}")

EndIf

If WinExists("Cannot find server - Microsoft Internet Explorer") Then

WinActivate("Cannot find server - Microsoft Internet Explorer", "")

Send("{F5}")

EndIf

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 0, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 0, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 50, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 30, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 100, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 55, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 150, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 80, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 200, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 105, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 250, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 130, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 300, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 155, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 350, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 180, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 450, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 205, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 500, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 230, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 550, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 255, 365, 760, 388)

Sleep (10000)

WinMove ("SiteScope Overview - Microsoft Internet Explorer", "", 600, 0, 410, 429)

WinMove ("http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer", "", 270, 365, 760, 388)

Sleep (10000)

If WinExists("Cannot find server - Microsoft Internet Explorer") Then

WinActivate("Cannot find server - Microsoft Internet Explorer", "")

Send("{F5}")

EndIf

If WinExists("Cannot find server - Microsoft Internet Explorer") Then

WinActivate("Cannot find server - Microsoft Internet Explorer", "")

Send("{F5}")

EndIf

WEnd

Link to comment
Share on other sites

A quick way to fix it might be to rename the window using (WinSetTitle ( "title", "text", "newtitle" )) after you send the F5 key.

Ex.

If WinExists("Cannot find server - Microsoft Internet Explorer") Then
WinActivate("Cannot find server - Microsoft Internet Explorer", "")
Send("{F5}")
WinSetTitle ( "Cannot find server - Microsoft Internet Explorer", "", "http://apmcso.mercuryportal.com/schedule/esupport.asp?view=1 - Microsoft Internet Explorer""
EndIf

Hope this helps,

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
Share on other sites

I don't think that will work because there are 2 windows and either one can go into error. And if I did that it would set them both to the same title and move them to the same place and we would only be able to see one.

I could do set name on both but then it might rename the wrong one, and since the windows are different sizes we would loose some visability.

What else?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...