?
Solved

AutoHotKey - Getting script to run only in certain programs

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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 …
Starting up a Project
Suggested Courses

752 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