Send("{F5}") does not work

Forum for MailWasher Pro 7 and/or older 2011/2012 versions.
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Send("{F5}") does not work

Fri Aug 31, 2012 10:39 pm

Is there a AutoIt-user who can solve the problem why "Send("{F5}")" in my AutoIt.exe nearly never works. I myself have to hit F5 to get the mail.
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Fri Aug 31, 2012 11:49 pm

What I have found is that the command is being submitted too soon and therefore not effective. Try putting in a wait delay to allow the called program to settle.
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 12:12 am

Try putting in a wait delay to allow the called program to settle.
$wait was 8, now it is 12. I wait and see. Thanks :?
Rob
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 5:00 am

Mine is "WinWaitActive for 10 if Outlook is already running and "WinWait" for 40 followed by a Sleep (10000) when it is not running. The not running occurance may still be a little too short depending on system activity.
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 6:27 am

I have to say that up till now "Send("{F5}")" does work like it should :D :D

but maybe this qoute will makes it still better :?:
Mine is "WinWaitActive for 10 if Outlook is already running and "WinWait" for 40 followed by a Sleep (10000) when it is not running. The not running occurance may still be a little too short depending on system activity.
How do I set it in mine AutoIt?
Do I have to give $Regex another value?

$regex = "[REGEXPTITLE:.*Eudora.*]"

; If Thunderbird is running activate it and check mail
If ProcessExists("eudora.exe") Then
If 0 == WinWait($regex, "", $wait) Then
MsgBox(64, "Window", "Not Found - Check your regex code")
Exit
EndIf ; Window not found
WinActivate($regex)
WinWaitActive($regex)
If $noget == "" then
Send("+{F5}") ; Check mail command
endif
Exit
EndIf ; ProcessExists


; If Thunderbird is not running start it, activate it and check mail
If 0 == Run($program) Then
MsgBox(64, "Program", "Not Found - Check your registry key")
Exit
EndIf ; Program not found
If 0 == WinWait($regex, "", $wait) Then
MsgBox(64, "Window", "Not Found - Check your regex code")
Exit
EndIf ; Window not found
WinActivate($regex)
WinWaitActive($regex)
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 6:58 am

Here is my full script:
AutoIt Outlook.jpg
AutoIt Outlook.jpg (105.28 KiB) Viewed 8176 times
The first two lines are there to distinguish whether the OS is 64 or 35 bit.
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 8:26 am

I want to copy your script, but I do not recognise the sign before "OSArch="X64";
what key is it on the keyboard?
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 9:22 am

robmeyer wrote:I want to copy your script, but I do not recognise the sign before "OSArch="X64";
what key is it on the keyboard?
Upper Case 2
It is the "at" symbol
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Sat Sep 01, 2012 6:31 pm

Hi Sidewinder,
I copied your script like this and please read the questions:
autoit_proef.jpg
autoit_proef.jpg (77.96 KiB) Viewed 8158 times
This script does not fetch mail
There is an error in the script, found by Ctrl-F5, but compiling has no problems.

For comparison here is the script I use: Mailfetching is a matter of good luck: sometimes it works, mostly not:
Eudora.jpg
Eudora.jpg (87.49 KiB) Viewed 8158 times
Do you see some line that could be better?
Thanks
Rob
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Sun Sep 02, 2012 1:19 am

robmeyer wrote:Hi Sidewinder,
I copied your script like this and please read the questions:
autoit_proef.jpg
This script does not fetch mail
There is an error in the script, found by Ctrl-F5, but compiling has no problems.

For comparison here is the script I use: Mailfetching is a matter of good luck: sometimes it works, mostly not:
Eudora.jpg
Do you see some line that could be better?
Thanks
Rob
The commands in question were keyboard shortcuts for navigating the UI menus. That version of Outlook when running and open in a different area (other than mail) would not respond correctly to the Send/Recieve some of the time. I found that by making sure that it was at a specific UI I/F it would the work most of the time.
F5 was the "old" Send/Receive command for Outlook. F9 is now designated as the current version, however mine still responds to the F5 key. My guess is that there were too many users with older scripts that it was just easier to leave the code in place.

I'm about to embark on a refresh of my Outlook unique script to update it to the latest set of keyboard shortcuts.
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
User avatar
Sidewinder
Weary Womble
Posts: 11678
Joined: Sun Mar 29, 2009 2:05 pm

Re: Send("{F5}") does not work

Sun Sep 02, 2012 3:17 am

Here is my latest update for Outlook 2010:
MWP Outlook 10R.jpg
MWP Outlook 10R.jpg (89.2 KiB) Viewed 8146 times
I am not a Firetrust employee. Just a MW User & Volunteer BETA Tester.
Remember "FREEDOM IS NEVER FREE" U.S.N.
DT W7 64 HP SP1 16GB Ram - LT W7 32 HP SP1 4GB Ram - iPad4 64 GB Ram WiFi/Cellular IOS 9.3 Beta 3
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Sun Sep 02, 2012 4:19 pm

This one works fine for me. Controlling with Tools\Ctrl-F5 finds an error with "^", but compiling is OK.
robmeyer
Guardian Gecko
Posts: 290
Joined: Wed Aug 12, 2009 7:01 pm

Re: Send("{F5}") does not work

Thu Sep 06, 2012 8:31 pm

The truth is that both scripts (yours and mine) don't fetch mail;
WHY :?: :?: :?:

Yours:
If @OSArch= "X64" then
$program = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\Mail\Eudora\shell\open\command","")
Else
$program = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Eudora\shell\open\command","")
EndIf

;$program = "D:\Global\EudoraOSE\eudora.exe"
If ProcessExists("eudora.exe") Then
Run($program)
WinActivate("EudoraOSE")
WinWaitActive(("EudoraOSE"), "", 10)
Send("^1")
Sleep (100)
WinActivate("EudoraOSE")
Send("{F5}")
Exit
Else
Run($program)
WinWait(("EudoraOSE"), "", 40)
Sleep(10000)
WinActivate("EudoraOSE")
Send("{F5}")
EndIf
Exit


Mine:
$program = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\Mail\Eudora\shell\open\command","")
;$program = "d:\Global\EudoraOSE\eudora.exe"

;$regex = "[REGEXPTITLE:.*EudoraOSE.*]"

; Check command line parameters.
; If parameter exists use this as the zoom level.
;If 2 parameters exist the first is the zoom and the second will stop the mail from being fetched
$zoom = 0
$noget = ""

if $CmdLine[0] == 1 Then
$zoom = $CmdLine[1]
EndIf
; 2 parameters 1st = zoom, second stop mail fetch.
if $CmdLine[0] == 2 Then
$zoom = $CmdLine[1]
$noget = $CmdLine[2]
EndIf

$wait = "15" ; Number of seconds to wait for the Window to become available before failing

; Now we have the information we need collected so we are ready to Activate or Run Thunderbird

; If Thunderbird is running activate it and check mail
If ProcessExists("eudora.exe") Then
If 0 == WinWait($regex, "", $wait) Then
MsgBox(64, "Window", "Not Found - Check your regex code")
Exit
EndIf ; Window not found
WinActivate($regex)
WinWaitActive($regex)
If $noget == "" then
Send("+{F5}") ; Check mail command
endif
Exit
EndIf ; ProcessExists

; If Thunderbird is not running start it, activate it and check mail
If 0 == Run($program) Then
MsgBox(64, "Program", "Not Found - Check your registry key")
Exit
EndIf ; Program not found
If 0 == WinWait($regex, "", $wait) Then
MsgBox(64, "Window", "Not Found - Check your regex code")
Exit
EndIf ; Window not found
WinActivate($regex)
WinWaitActive($regex)

;Use the zoom level from the command line parameter if one exists
if $zoom <> 0 Then
Send("{CTRLDOWN}")
$i = 0
Do
Send("{NUMPADADD}")
$i = $i + 1
until $i = $zoom

Send("{CTRLUP}")
EndIf

If $noget == "" then
Send("{F5}") ; Check mail command
EndIf
Exit

Return to “MailWasher Pro 7”