Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AutoHotKey - Getting script to run only in certain programs

Posted on 2011-03-22
4
Medium Priority
?
863 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression

636 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