Solved

AutoHotKey - Getting script to run only in certain programs

Posted on 2011-03-22
4
854 Views
Last Modified: 2012-05-11
I'm running the script below in AutoHotKey

^e::
If WinActive("ahk_class MozillaUIWindowClass") Or WinActive("ahk_class MozillaWindowClass")
  Send, {Ctrldown}k{CtrlUp}
Return

It works great in Firefox to send a Control + k when I press Control + e.

The issue is when I use any other programs.  Control + e makes nothing happen. I want control + e to still work in other apps.

I tried putting in an else like this:
Else
  Send, {Ctrldown}e{CtrlUp}

...but then the script then loops and my PC gets crazy.

Any and all help is appreciated!

Thank you,

John
0
Comment
Question by:JohnMan777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
Unattended earned 500 total points
ID: 35879452
try:
Send, ^k

or your window title definition might not be right:
If WinActive("ahk_class MozillaUIWindowClass") Or WinActive("ahk_class MozillaWindowClass")

I tried it with notepad, and it worked fine for me.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 36128377
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Comment

by:JohnMan777
ID: 36105532
This got it working:


#IfWinActive ahk_class MozillaWindowClass

^e::

Send, {CTRLDOWN}k{CTRLUP}

return

#IfWinActive
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn different types of Android Layout and some basics of an Android App.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question