Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close a program (Outlook) based on wait time?
#1
I'm hoping that this is a relatively simple request for those of you who, unlike me, seem to be advanced users of QM.

I need a macro or function that would close Outlook if my computer has been idle for a specified period of time (probably an hour). I usually keep several instances of Outlook running, one for calendar, one for email, one for contacts, etc. This macro therefore needs to shut down the whole program, not just close an open Outlook window. Can someone help? Would be much appreciated.
#2
Run this macro before leaving your computer or temporarily not working on it.

Macro Close All Outlook Windows
Code:
Copy      Help
ARRAY(int) a; int i
win("" "" "outlook" 0 0 0 a)
if(a.len)
,60*60  ;; 60 min * 60 sec
,for(i 0 a.len) clo a[i]
#3
To run a macro on idle, try Windows Task Scheduler. In macro Properties dialog click Schedule...

Or use function WaitIdle. Example:
Macro Macro2515
Code:
Copy      Help
int w=win("" "" "outlook")
if(!w) ret ;;nothing to do
WaitIdle 60*60
;now close Outlook windows with Lionking code, or with function CloseWindowsOf, etc


Forum Jump:


Users browsing this thread: 1 Guest(s)