I am searching for hours in the web and this forum too but no articles helps really.
In the background Thunderbird is running and receives mails and fax (as PDF mails). If a specific mail will be received and the rules detect this mail an external program will be executed. The external program is the AutoIt script. Execution will be okay but the result is not okay: If the button $btnShowMailProg is pressed: The Thunderbird should appear to show the important mail.
==> This is the problem.
I have tried several times and different code examples but Thunderbird will not be shown in the front. Who can help me or show a code example which shows an already in background running program active again in the foreground?
Thanks in advance for your help.
Sorry, the GUI is for a german office usage and therefore the text messages are in german. But this doesn't matter for the asked issue.
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> $Form1_1 = GUICreate("BENACHRICHTIGUNG: Wichiges FAX eingegangen", 422, 220, -1, -1,$WS_EX_TOPMOST) $Label1 = GUICtrlCreateLabel("Diese Benachrichtigung wird angezeigt, weil die Filter-Regeln", 24, 18, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $Label2 = GUICtrlCreateLabel("im Email-Programm den Eingang eines wichtigen FAX oder", 24, 38, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $Label3 = GUICtrlCreateLabel("einer wichtigen EMAIL festgestellt haben.", 24, 58, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $btnShowMailProg = GUICtrlCreateButton("Email-Programm in den Vordergrund bringen", 24, 92, 355, 33, 0) GUICtrlSetFont(-1, 10, 700 , 0, "Arial") $btnClose = GUICtrlCreateButton("Dieses Fenster schließen", 24, 135, 203, 41, 0) GUISetState(@SW_SHOW) $hWnd = WinGetHandle("[ACTIVE]") WinSetOnTop($hWnd, "", $WINDOWS_ONTOP) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnClose Exit case $btnShowMailProg if ProcessExists("thunderbird.exe") Then $hWnd2 = ProcessExists("thunderbird.exe") WinSetOnTop($hWnd, "", $WINDOWS_NOONTOP ) GUISetState(@SW_HIDE) $return0 = WinActivate($hWnd2) $return1 = WinSetState($hWnd2, "", @SW_MAXIMIZE) $return2 = WinSetState($hWnd2, "", @SW_SHOW) MsgBox (0, "DEBUG-Info", "$hWnd2=" & $hWnd2 & @CRLF & "$return0=" & $return0 & @CRLF & "$return1=" & $return1 & @CRLF & "$return2=" & $return2 ) If Not WinActive($hWnd2) Then MsgBox (0, "DEBUG-Info", "Thunderbird manuell öffnen!" ) Run("thunderbird.exe") WinActivate($hWnd2) WinSetState($hWnd2, "", @SW_MAXIMIZE) WinSetState($hWnd2, "", @SW_SHOW) EndIf MsgBox (0,"INFO","Programm wird beendet.") Else MsgBox (0, "DEBUG-Info", "Thunderbird manuell öffnen!" ) EndIf Exit EndSwitch WEnd Exit
Profiler - yet another backup script for Firefox and Thunderbird profiles
It automatically detects the last recently used profile directories of Firefox and Thunderbird (installed versions, no portables).
Clicking the Backup-Button creates a complete Backup of the found profiles with a timestamp.
Restore deletes the according profile dir and extracts the content of the selected archive into the profile directory.
Uses Winrar as compression tool, but feel free to change it to your needs
So, Thunderbird does not have a minimize to tray option. Here is a handler to do just that.
More info. at https://www.autoitscript.com/forum/topic/187431-thundrebird-to-tray/
I am trying to achieve the following:
When an email is received with a specific subject field, I want to trigger an autoit script.
I am not sure how to do the first part (monitor emails and check for the email subject filed, or even better, email content).
I have no specific requisites about the email client, it could be outlook, thunderbird, or other. It would be okay as well to read the email header only from an online gmail account.
I know it is possible with a gmail account (there are severals widgets that can do that) but I was wondering if this can be done using autoit ? My programming knowledge is very poor, and I doubt I can go through the use of Google APIs for this.