Solved

AutoHotKey - Getting script to run only in certain programs

Posted on 2011-03-22
4
837 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
This is an explanation of a simple data model to help parse a JSON feed
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now