Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set a macro to run whenever a particular window is activated
#3
Hi,

1)

Its not obvious how do I use it and also how I customize it for other windows.

Can u explain ?

Note : I am using METAPAD text editor as a replacement of notepad (windows 7's own)


I copied the whole text in a File -> New -> function
as this -

Code:
Copy      Help
Function auto_caps_lock
;; Trigger !a"Notepad" "Notepad"
;; Trigger !a"metapad" "metapad"

int hwnd=val(_command)
ifk-(K 1) key K
wait 0 -WA hwnd
ifk(K 1) key K

with the trigger as - !a"new file - metapad" "ahk_class metapad" (made by rightclick on the function -> properties -> trigger - window -> active


and nothing is happening when I keep capslock off and then activate the metapad.


2)

And the code is a bit complex - - how to make capslock off for a particualr window too.

Can this particular requirement guide be found in the help file ?


3)

Also can u tell me how to set similar rules for like when a window contains a particular substring in its title - like say the macro is run whenever any window title must not be the same exact as "firefox" but it may even only contain the substring "firefox". eg. - "Yahoo news - Firefox"


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)