ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Make script work only on specific apps?

(1/1)

substep:
Right now this script excludes apps. I want to invert it so it will work only on selected apps (*.exe preferrably).

--- Code: Autohotkey ---SetTitleMatchMode, 2~MButton::ifwinactive ahk_class MozillaUIWindowClassreturnifwinactive ahk_class Progman    returnifwinactive ahk_class Shell_TrayWnd    returnifwinactive ahk_class MozillaDialogClass    returnifwinactive ahk_class NotifyIconOverflowWindow    return Send !{F4}Return

skwire:
Take a look at the #IfWinActive directive in AHK:

http://www.autohotkey.com/docs/commands/_IfWinActive.htm

Target:
simply substitute the returns in your ifwinactive statements for the send routine (and of course you'll need to amend the AHK classes as appropriate)

substep:
Thx, now it's finished.

--- Code: Autohotkey ---SetTitleMatchMode, 2 #ifwinactive ahk_class TForm1~MButton::Send !{F4}Return #ifwinactive ahk_class TfrmStarter~MButton::Send !{F4}Return #ifwinactive ahk_class AkelPad4~MButton::Send !{F4}Return #ifwinactive ahk_class mp3DCWndClass~MButton::Send !{F4}Return #ifwinactive, Postbox~MButton::Send !{F4}Return #ifwinactive ahk_class XmainClass~MButton::Send !{F4}Return

skwire:
You can shorten it up a bit by using groups.


--- Code: Autohotkey ---SetTitleMatchMode, 2 GroupAdd, Alt_F4_Group, ahk_class TFormGroupAdd, Alt_F4_Group, ahk_class TfrmStarterGroupAdd, Alt_F4_Group, ahk_class AkelPad4GroupAdd, Alt_F4_Group, ahk_class mp3DCWndClassGroupAdd, Alt_F4_Group, ahk_class PostboxGroupAdd, Alt_F4_Group, ahk_class XmainClass #ifwinactive ahk_group Alt_F4_Group~MButton::Send !{F4}Return

Navigation

[0] Message Index

Go to full version