How to use a script with a closed laptop lid?

So I have a script that works fine.

There he is:

#SingleInstance force
#Persistent
settimer, idleCheck, 1000 ; check every second
return

idleCheck:
if WinExist("App Name with or without Spaces") ; if app is running
{
    if(A_TimeIdle >= 270000) ; and there was no input in 4.5 min
    {
        WinActivate ; switch to that app
        sendInput z ; and perform an action
    }
}
return 

But as soon as the lid is closed (not in a dream), it is not for obvious reasons.

Is there a way to do things when it closes or β€œtricks” the OS to think that the lid is open when it closes.

Hope this makes sense.

The solution does not have to be in .ahk. I just need a script to work with which it doesn't matter.

Thanks in advance.

+4
source share
1 answer

This is due to the assumption that your laptop really goes into some kind of "sleep mode" when the cover is closed.

If so, I don't think you need an AHK script for this.

. : enter image description here


, ... enter image description here

, , .

" " .

, .

+3

Source: https://habr.com/ru/post/1570780/


All Articles