"Skype for Business" (formerly "Microsoft Lync") is harder to wake up than my daughter. When it is minimized to the taskbar, clicking on the icon to restore it is inteminably slow -- it literally takes 5-10 seconds to restore if it has been idle for a while. This is a known issue that is often complained about (such as here or here), but no resolution or workaround has been provided.
However, there is one glimmer of hope that I would like to exploit, if possible. As I mentioned above, Skype is unresponsive only after it has been idle for some time. If the user is actively using it then it operates just fine. So... I would like to find a way to "jar" it every hour or so -- to keep it active.
My initial strategy: Use Task Scheduler to schedule the following WScript (hourly):
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate "Skype for Business" 'give app focus
WScript.Sleep 100 'give app time to load
WshShell.SendKeys "% r" 'restore app
WshShell.SendKeys "% n" 'minimize app
This works fine if the app is already minimized, but if the app is active (in focus) it will suddenly disappear. (If I omit the final line, then the app will pop up on top of whatever else I was currently working on.) I tried replacing the final two lines with this one instead:
WshShell.SendKeys "% {ESC}"
...which just opens and closes a menu. This works better, but it shifts focus to Skype (albeit momentarily) which causes further problems. It also unhides the taskbar and lights up the Skype icon (as if I had a message waiting).
QUESTION: Does anyone know if I can use AutoHotKey for this sort of thing?
Basically, I'm looking for some sort of script that can do this: determine whether the Skype window is currently active; if it is, do nothing. Otherwise, send some invisible command to it (for example: maximize then minimize), but in all cases to restore the window to its previous state.
Any suggestions? (An autohotkey script would be very much appreciated!)