Jump to content

Auto close when application is idle


Recommended Posts

hi all,

         in my script, i want to close the application/file, when application is idle,... opened application is not closed pls anyone help...☹️

 

<#include <File.au3>
#Include <Array.au3>
#include <Timers.au3>
#include <MsgBoxConstants.au3>
#include <WinAPISys.au3>
Local $path = "D:\CTS ppt"
Local $FileArray = _FileListToArrayRec($path, '*.ppsx', 1)
For $i = 1 To $FileArray[0]
    If StringInStr($FileArray[$i], ".ppsx") > 0 Then
        $ppsx =ShellExecuteWait($path & "\" & $FileArray[$i])
        Send("{F5}")
        While 1
            If _WinAPI_GetIdleTime() >= 1 * 30 * 1000 Then
                ;MsgBox (0, "Time reached", "You have been idle.")
                WinClose($FileArray[$i])
            EndIf
            Sleep(10 * 1000)
        WEnd
    EndIf
Next>

Link to comment
Share on other sites

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...