Jump to content

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

Auto Refresh page in firefox


  • Please log in to reply
16 replies to this topic
dannyngai
  • Members
  • 3 posts
  • Last active: Jun 09 2009 10:37 AM
  • Joined: 08 Jun 2009
I would like to auto refresh a page in firefox on an hourly basis while I need to surf to other website.
Not sure if anyone can help modifying my code below so that only the specified page are refreshed but not those active pages I am browsing.

Thank you in advance.
____________________________________________________

run <!-- m -->http://www.yahoo.com<!-- m -->
IfWinActive ahk_class MozillaUIWindowClass
{
^R::
loop
{
WinWaitActive, ahk_class MozillaUIWindowClass
if ErrorLevel
{
WinWait timed out
return
}
else
{
send {F5}
sleep 360000
}
}

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006
mate, i think this add-on would be a bit easier and more versatile:

<!-- m -->https://addons.mozil...refox/addon/115<!-- m -->

dannyngai
  • Members
  • 3 posts
  • Last active: Jun 09 2009 10:37 AM
  • Joined: 08 Jun 2009
Thanks d-man. That's a great plug in.

However, as a beginner of programming, i wish anyone who can help me to finish my code using the my short cut.


Thanks.

  • Guests
  • Last active:
  • Joined: --
d-man,
btw, the reload plugin is not ready for the latest firefox 3.08.

tank
  • Moderators
  • 4238 posts
  • Last active: Today, 02:20 PM
  • Joined: 21 Dec 2007
seach this forum for browser class

  • Guests
  • Last active:
  • Joined: --

I would like to auto refresh a page in firefox on an hourly basis while I need to surf to other website.
Not sure if anyone can help modifying my code below so that only the specified page are refreshed but not those active pages I am browsing.

Thank you in advance.
____________________________________________________

run <!-- m -->http://www.yahoo.com<!-- m -->
IfWinActive ahk_class MozillaUIWindowClass
{
^R::
loop
{
WinWaitActive, ahk_class MozillaUIWindowClass
if ErrorLevel
{
WinWait timed out
return
}
else
{
send {F5}
sleep 360000
}
}



************************************
Anyone can help above?

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006

Thanks d-man. That's a great plug in.

However, as a beginner of programming, i wish anyone who can help me to finish my code using the my short cut.


Thanks.


It doesn't pay to try to do everything with AHK. The very reason I give another easier more practical way is that AHK is not good for what you are doing. Especially as a "beginner of programming" you might try something easier. This is also the reason why no one answers you.

You might try learning about postmessage and controlsend and things like that about sending commands to background window objects, as well as understanding the ClassNN objects. You see how this is not beginner programming stuff. And by the looks of your code, you don't even have the basics down.

This guy claims to have made some progress, but I couldn't figure it out:
<!-- m -->http://www.autohotke... ... ab firefox<!-- m -->

To try it in a more basic way, lookup the "SetTimer" command. Something like,

#persistent
SetTimer, Refresh, 3600000
return

Refresh:
; activate Mozilla and press F5
return

You also might try using the image search feature to find the tab on the screen and focus it. Or select the list of tabs. Then you can select the page and refresh it. Or, if it would work for your particular interest, simply have the script open the webpage every so often. You could also try to use key and mouse commands to focus the right tab, refresh, and then move back.

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006
This thread looks like it could be very helpful:

[Find any Firefox tab]
<!-- m -->http://www.autohotke... ... st windows<!-- m -->

dannyngai
  • Members
  • 3 posts
  • Last active: Jun 09 2009 10:37 AM
  • Joined: 08 Jun 2009

Thanks d-man. That's a great plug in.

However, as a beginner of programming, i wish anyone who can help me to finish my code using the my short cut.


Thanks.


It doesn't pay to try to do everything with AHK. The very reason I give another easier more practical way is that AHK is not good for what you are doing. Especially as a "beginner of programming" you might try something easier. This is also the reason why no one answers you.

You might try learning about postmessage and controlsend and things like that about sending commands to background window objects, as well as understanding the ClassNN objects. You see how this is not beginner programming stuff. And by the looks of your code, you don't even have the basics down.

This guy claims to have made some progress, but I couldn't figure it out:
<!-- m -->http://www.autohotke... ... ab firefox<!-- m -->

To try it in a more basic way, lookup the "SetTimer" command. Something like,

#persistent
SetTimer, Refresh, 3600000
return

Refresh:
; activate Mozilla and press F5
return

You also might try using the image search feature to find the tab on the screen and focus it. Or select the list of tabs. Then you can select the page and refresh it. Or, if it would work for your particular interest, simply have the script open the webpage every so often. You could also try to use key and mouse commands to focus the right tab, refresh, and then move back.


Thanks for help, d-man. I got your ideas. Can I just refresh the page without switching the firefox tab? Because I can't surfing the web at the same time I fresh regularly on a specific page. Actually, I can open a separate Firefox windows for browsing and let alone the specific page for autorefresh without your switching tab ideas. I just need some help so that I can refresh a specific page in firefox repeatedly? Anyone can help?

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006
If you keep the web page in a separate window, instead of tab, it makes it very easy. The tabs are what is difficult to work with.

Here's a script that can get you started:

!r::

started := !started

if !started
{
SetTimer, refresh, Off
msgbox, Auto-refresh is off.
return
}

inputbox, titty,, What's the title of your web page?,, 240,120

inputbox, minny,, How many minutes between refreshing?,, 280,120

msgbox, Started refreshing. Push ALT-R again to stop refreshing.

milly := minny * 1000 * 60

SetTimer, refresh, %milly%

return

refresh:
controlsend MozillaWindowClass1,{F5},%titty%
return


  • Guests
  • Last active:
  • Joined: --

If you keep the web page in a separate window, instead of tab, it makes it very easy. The tabs are what is difficult to work with.

Here's a script that can get you started:

!r::

started := !started

if !started
{
SetTimer, refresh, Off
msgbox, Auto-refresh is off.
return
}

inputbox, titty,, What's the title of your web page?,, 240,120

inputbox, minny,, How many minutes between refreshing?,, 280,120

msgbox, Started refreshing. Push ALT-R again to stop refreshing.

milly := minny * 1000 * 60

SetTimer, refresh, %milly%

return

refresh:
controlsend MozillaWindowClass1,{F5},%titty%
return


I can't process your code exactly? maybe some error in your "controlsend" line"?

tank
  • Moderators
  • 4238 posts
  • Last active: Today, 02:20 PM
  • Joined: 21 Dec 2007
ok one more time since you refused to take my suggestion

search the forum for "browser class"

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006

I can't process your code exactly? maybe some error in your "controlsend" line"?


You're right, controlsend only works intermittently with Firefox. I don't know why.

Replace that line with:
controlclick, x122 y71,%titty%

This worked for me. You may have to adjust the x and y coordinates.

Next time just ask someone to write the script for you, then it will be clearer what you want.

d-man
  • Members
  • 289 posts
  • Last active: Sep 21 2013 08:09 PM
  • Joined: 08 Jun 2006

ok one more time since you refused to take my suggestion

search the forum for "browser class"


I couldn't find any relevant threads with this. Maybe a direct link would be helpful... but I know lazy people are so annoying. :lol: :lol:

  • Guests
  • Last active:
  • Joined: --

ok one more time since you refused to take my suggestion

search the forum for "browser class"


I couldn't find any relevant threads with this. Maybe a direct link would be helpful... but I know lazy people are so annoying. :lol: :lol:


d-man, you are so annoying yourself. Pls don't leave your buggy code if you can't help. FU.