
Shutdown/Hibernate computer when Opera completes transfers Maybe it'll be better if the script could still work, as some other code is written in this script and this one is only a part of a larger one.įor information I found this ahk exe but there is no source to watch as an example : With this code the script stop waiting for the exact match to appear, then shutdown. ReturnMaybe it is better to write it with some sort of loop, or spy on the download window title change. Shutdown, 8 Desactivated for testing purpose SetTitleMatchMode reset it to default/previous state WinWaitClose, Transfers - Opera ahk_class OperaWindowClass

Waits until the specified window does not exist. added a sleep and a close opera command, because when restarting the PC opera opens with an error window PostMessage, 0x112, 0xF060, Transfers - Opera ahk_class OperaWindowClass 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE PostMessage, 0x112, 0xF060, WinTitle, WinText 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE It might produce different behavior because it is similar in effect to pressing Alt-F4 or clicking the window's close button in its title bar: An alternate method of closing is to send the following message. Sleep, 2000 just to be safe and let the downloaded file transfer operation finish SetTitleMatchMode,3 3: A window's title must exactly match WinTitle to be a match. WinActivate, Transfers ahk_class OperaWindowClass Not sure if the window need to be active for it to work IfWinExist, Transfers ahk_class OperaWindowClass

3 - Wait indefinitely for exact window title to appear, reset SetTitleMatchMode to previous value then shutdown, or any other Shutdown options. 2 - Change The title mach mode to exact match.ĭon't know the default, would like to restore to default/previous state just before shuting down. So, I just wrote Transfers as window title and added ahk_class OperaWindowClass I don't know (maybe thru regex if possible in a window title) how to code Transfers XX:XX - Opera opera window title. Although, I'm not sure if the specified window need to be active for it to work ? 1 - Activate Opera window, providing that one had selected the download tab before starting the script. When there is a transfer, Opera title bar will contain Transfers XX:XX - Opera and this will change to Transfers - Opera when transfer completes. I searched as usual but need some help out there, here it is :
