autohotkeys using ifwinactive with expression not working -


i using autohotkeys test if window active along expression. don't seem able work. assigning expression variable , testing ifwinactive , variable. autohotkeys doesn't seem able evaluate expression correctly. script:

^w:: ;hotkey fires  done = false   settimer, checkpopups, 10000    ; check every 10 seconds window checkpopups:     := (done != true)  #ifwinactive "volume spike - down" ,  { ;specific lines when active window true , done false msgbox hello done := true  } ifwinnotactive volume spike - down { done = false } 

when launch script , window not active, shows message box hello. 10 seconds later shows again. should show message box if window active , done = false. idea doing wrong?

you're using #ifwinactive, a directive used create conditional hotkeys. should use ifwinactive instead.

you can use function version, winactive() inside if-clause. makes little cleaner in opinion.

here's short example:

#persistent  done := false settimer, checkpopups, 1000 ; check every second window return  checkpopups:      if ( winactive("volume spike - down") ) , (!done) {         msgbox, hello         done := true     } else {         done := false     }  return 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -