I want Windows to automatically close a specific folder in File Explorer, either after only that folder experiences inactivity (preferred), or after a period of inactivity with the PC as a whole. I guess probably the folder would be closed based on its specific title. As a last resort, it would be okay if all File Explorer folders were closed after a period of inactivity.
Is this possible?
To explain: I want to make sure work folders are closed when not in use so that my kid doesn't accidentally (or intentionally) mess with them when he uses my PC.
Close a specific folder after inactivity?
-
- Posts: 15
- Joined: 04 Feb 2018, 21:54
Re: Close a specific folder after inactivity?
Hello,
You could set a timer to check A_TimeIdlePhysical. When it exceeds a certain value, you can WinClose.
You could set a timer to check A_TimeIdlePhysical. When it exceeds a certain value, you can WinClose.
-
- Posts: 15
- Joined: 04 Feb 2018, 21:54
Re: Close a specific folder after inactivity?
mikeyww wrote: ↑30 Apr 2024, 16:47Hello,
You could set a timer to check A_TimeIdlePhysical. When it exceeds a certain value, you can WinClose.
Thank you, I'm having trouble getting it to work. Would anyone be able to help me with this script?
For example, close a folder called "Work" if inactive for 5 minutes.
Thank you.
Re: Close a specific folder after inactivity?
Code: Select all
#Requires AutoHotkey v1.1.33.11
dir := "utils" ; Window title of File Explorer
closeAfterMin := 5
#Persistent
#InstallKeybdHook
#InstallMouseHook
Process Priority,, B
closeAfterMS := 60000 * closeAfterMin
winTitle := dir " ahk_class CabinetWClass"
SetTimer Check, 5000
Check:
ToolTip % A_TimeIdlePhysical
If WinExist(winTitle) && A_TimeIdlePhysical > closeAfterMS {
WinClose
SoundBeep 1500
}
Return
Who is online
Users browsing this forum: Daimonicon, Google [Bot], vsub and 101 guests