Page 1 of 1

How come some time ahk doesn't work

Posted: 21 Sep 2019, 09:20
by ethanross1a
This applies to most scripts, it seems sometimes a script doesn't work. and I'd have to click the taskbar, then it works. Is it a focus thing?

Re: How come some time ahk doesn't work

Posted: 21 Sep 2019, 12:08
by ilhom
Can you post an example script that stops working for you?
What program do you have in focus where it stops working, and then starts working when you click the task bar?

Re: How come some time ahk doesn't work

Posted: 23 Sep 2019, 06:26
by ethanross1a
Here's one that didn't work just then, until i click on the taskbar, then it worked.

Code: Select all

#d::Run, C:\Users\A\Dropbox

i'm not sure if the above code IS the problem, since many many other scripts have the same issue. Can the following script be causing this problem?

Code: Select all

~WheelUp::mouseWheelVolume("+4")
~WheelDown::mouseWheelVolume("-4")
mouseWheelVolume(step)
{  mouseGetPos,mx,my,wnd
   wingetClass,cls,ahk_id %wnd%
   if cls=Shell_TrayWnd
   {  SoundSet %step%
      soundSet 0,,mute
      soundGet vol
      ifInString,vol,.
         stringMid,vol,vol,1,% inStr(vol,".")-1
      tooltip, Volume:%vol%`%,% mx+8,% my+8,19
      setTimer removeVolumeTip,2000
   }
   return
removeVolumeTip:
   tooltip,,,,19
   settimer removeVolumeTip,OFF
   return
}

#MaxHotkeysPerInterval 200