How to temporarily disable script when dialog popup Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
BriHecato
Posts: 124
Joined: 18 Jul 2017, 07:17

How to temporarily disable script when dialog popup

21 Jul 2017, 01:42

I prefer to to use "one-key-hotkeys" (OKH) (not two- three- key combinations) in apps [letters q,w,e,a,s,d,z,x,c]. But of course if open/save dialog popups my scripts still working and messing with keyboard navigation around folders and files.

So I want my script to be disabled in dialogs but still works in main window. How to do this?

My code is very basic

Code: Select all

#IfWinActive ahk_exe software.exe
q::
	Send, {Home}{Right}{Right}{Right}
	Send, ^C
....
and so on.

Another question that is close connected to this is :

How to link script with elements of interface?
So my script works only in one given editbox, only in grid control, or only on graphic canvas but not on menus.
User avatar
BriHecato
Posts: 124
Joined: 18 Jul 2017, 07:17

Re: How to temporarily disable script when dialog popup

24 Jul 2017, 08:20

I found workaround for this topic but it doesn't work all the time.

I'm using classes instead of exe:

Code: Select all

#IfWinActive ahk_class WindowsForms10.Window.8.app.0.141b42a_r9_ad1
But, but, but there's two little issues - in my work I got three applications that:
1. are changed / updated each month by our IT subcontractor (but unfortunatelly not in a way that I would like to see and use)
2. have the same class...
So my scripts works in all of them instead this one I want, and works in little window.

I was forced to change hotkeys from q:: ^q::

My question has changed to:
How to add two conditions to #IfWinActive based on class and exe since

Code: Select all

#IfWinActive (ahk_class WindowsForms10.Window.8.app.0.141b42a_r9_ad1) and (ahk_exe software.exe)
doesn't work
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to temporarily disable script when dialog popup  Topic is solved

24 Jul 2017, 11:22

Hallo,
whats about?

Code: Select all

#IfWinActive ahk_class WindowsForms10.Window.8.app.0.141b42a_r9_ad1
$q::
	IfWinActive ahk_exe software.exe
		Send, {Home}{Right 3}^c
	Else
		Send, q

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, Google [Bot], vysmaty and 242 guests