cutefluff Posted July 3, 2014 Share Posted July 3, 2014 (edited) hi all i have a problem closing this script after it finishes its run... the autoit icon stays and appears as "paused" besides that it does what it should - check for a file and according to its modify date run it for some days as described in the ini file any help would be appriciated thanks and have a great weekend Sean. If FileExists("Q:TermAutoit_Codesafety_eventssafety_event.ppsx") Then $days2run = Int(IniRead("Q:TermAutoit_Codesafety_eventssafety_events.ini", "SCRIPT_PARAMETERS", "days2run", "2")) * 24 $win_timeout = Int(IniRead("Q:TermAutoit_Codesafety_eventssafety_events.ini", "SCRIPT_PARAMETERS", "timeout_sec", "60")) * 1000 Dim $safety_event_timestamp $safety_event_timestamp = FileGetTime("Q:TermAutoit_Codesafety_eventssafety_event.ppsx", 1, 0) $safety_event_timestamp_lag = _DateDiff('D', $safety_event_timestamp[0] & "/" & $safety_event_timestamp[1] & "/" & $safety_event_timestamp[2] & " " & $safety_event_timestamp[3] & ":" & $safety_event_timestamp[4] & ":" & $safety_event_timestamp[5], _NowCalc()) If $safety_event_timestamp_lag < $days2run + 1 Then ShellExecute("Q:TermAutoit_Codesafety_eventssafety_event.ppsx", "", "", "", @SW_MAXIMIZE) Sleep($win_timeout) WinKill("PowerPoint Slide Show - [safety_event]") EndIf EndIf Exit Edited July 3, 2014 by cutefluff Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 3, 2014 Moderators Share Posted July 3, 2014 You need to add error checking in your script, to see where the problem is. Look at @error, and ConsoleWrite in the help file. If you aren't generating any errors, a ConsoleWrite after every step can at least tell you how far you're getting. You can also use Opt("TrayIconDebug", 1). Then when the script stalls, you can hover your mouse over the tray icon and see which line it is sitting at. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 3, 2014 Share Posted July 3, 2014 (edited) I can't say exactly why the AutoIt icon stays in the tray after the program exit's, but it says 'paused' only because that is the default operation that is performed when the icon is clicked on. The script doesn't go into that state until then. The icon may still be there because the script isn't actually exitting when it should, IOW, it may still be running for some reason. The error checking that JLogan3o13 suggested is probably the only way to determine what the reason is, or where it is.. Use the blue A button, or manually use autoit tags to post your code in the future. Edited July 3, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now