Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Graceful app close or a loop to ask for the users help?

$
0
0

I have searched everywhere on this and it's a tough thing to search for.  Search strings like "autoit ask user to close applications" and "autoit graceful app shutdown" have turned up very little.

 

 

I'm writing a script to automate adding a profile to Outlook for a large user base.  It will run on each user's machine and delete Outlook profiles and add a new one in and automate the creation and send user name and information etc.

 

The problem is this:  Outlook may be open on the user's machine.  So I'm trying to either have a while loop (or similar) that checks if Outlook is open [winexists("Outlook")] and if the window is there, ask the user to close outlook.  Then check again to ensure Outlook is closed until the user closes outlook.  Once it's closed, continue on with the script.

 

I can't quite figure out a loop to to do this.  

 

I tried something like this:

  1. if winexists("Outlook") then
  2.    msgbox(16, "Outlook is open","Please close outlook and click 'OK'")

And that is not behaving correctly.  

//

 

The first thing I tried before arriving on this solution is winclose("Outlook")  The problem there is that sometimes that worked fine but sometimes, when I launched Outlook at the end of my script, Outlook would open saying it did not shut down correctly and asks the user for additional input.  This obviously is bad for my scripting attempts.  It usually works, but sometime it does now.  I'm assuming this is from Autoit killing the outlook process vs a graceful shutdown from the user.  Any help would be greatly appreciated!

 

(P.S. Sorry for the longs post.  Just wanted to be clear...)

 

Thanks in advance,

Chris


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>