Jump to content

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

F5 Function Key


  • Please log in to reply
6 replies to this topic
Marshey
  • Members
  • 6 posts
  • Last active: Mar 03 2012 07:18 PM
  • Joined: 27 Jan 2012
I have the below script and like to refresh a specific screen. Currently the script is doing an AltTab through all screens but only need to refresh one. Currently the Send F5 key is refrershing all screens. Any help would be great. Thanks................
-----------------------------------------------
#Persistent
Settimer, sendaltTab, 15000 ;15 seconds

Return

sendaltTab:
Send, {ALT DOWN}{TAB 2}{ALT UP}
Send, {F5}

Return
------------------------------------------------

  • Guests
  • Last active:
  • Joined: --
I don't know what kind of screen you have but instead of using alttab you could try: WinMinimize / WinMaximize and then f5

<!-- m -->http://www.autohotke...WinMinimize.htm<!-- m -->

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011
Another option is checking if the window you whant to send F5 to is active and send F5 only if so.

IfWinActive:
<!-- m -->http://www.autohotke...IfWinActive.htm<!-- m -->


Also, you can possibly ControlSend the F5 directly to the window you whant to update even if it is not currently active.

ControlSend:
<!-- m -->http://www.autohotke...ControlSend.htm<!-- m -->

A third option is to PostMessage/SendMessage to the window.

PostMessage/SendMessage:
<!-- m -->http://www.autohotke...PostMessage.htm<!-- m -->

Marshey
  • Members
  • 6 posts
  • Last active: Mar 03 2012 07:18 PM
  • Joined: 27 Jan 2012
The screen is from SQL. When the script gets to that screen I would like to have it refreshed with F5. Not sure what WinMinimize and WinMaximize would help. Is there a sample script that shows how to do this? Thanks.

Marshey
  • Members
  • 6 posts
  • Last active: Mar 03 2012 07:18 PM
  • Joined: 27 Jan 2012
Will this work...............Thanks

#Persistent
Settimer, sendaltTab, 30000 ;30 seconds

Return

sendaltTab:
Send, {ALT DOWN}{TAB 3}{ALT UP}

IfWinActive, PL/SQL Developer - [email protected]
{
Send, {F8}
Return
}

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011
Basically, it will do the following (i may be wrong though, its usually best to test it)

After each 30 second delay in time, it will hold down the Alt key, send 3 tabs and release the Alt key. After that, it will check wheter the window "PL/SQL Developer - [email protected]" is active and if so, send an F8 (or F5 is case you mistyped F8 on your last post).

I would recommend the following:

1- Change "PL/SQL Developer - [email protected]" to "PL/SQL" if there is no possibility for two windows to have the first letters of the title match PL/SQL.

It will also make it easyer for the script to find the correct window if a single space or letter is actually misstyped when writing the script.

2- It could be best to use WinActivate prior to the IfWinActive to ensure that the script does update the window after every 30 seconds of elapsed time. It will also eliminate the need of the alt-tabs.

3- ControlSend or PostMessage/SendMessage could be used to send the F8 command to the window without activating it. This would be the best option if you don't whant the window to pop-up after each 30 seconds in order to update.

Heres what i would write (in case there is no problem to have the window poping-up after each 30 seconds):

#Persistent
Settimer, sendaltTab, 30000 ;30 seconds

Return

sendaltTab:
IfWinNotActive, PL/SQL
WinActivate, PL/SQL
WinWaitActive, PL/SQL
{
Send, {F8} ; Is this really F8 or you mistyped F5?
}
return


Marshey
  • Members
  • 6 posts
  • Last active: Mar 03 2012 07:18 PM
  • Joined: 27 Jan 2012
It is the F8 key. Let me explain what I am trying to do. I would like to tab through all screens that are already opened. When it gets to SQL I would like to have do an F8 which actually updates the querry in SQL. The below script seems to work unless there is another way to do this. Thanks

#Persistent
Settimer, sendaltTab, 10000 ;10 seconds

Return

sendaltTab:
Send, {ALT DOWN}{TAB 3}{ALT UP}
IfWinActive, PL/SQL
{
Send, {F8}
}
Return