AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Closing active tab in firefox, else close window.. help!

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dieselweasel



Joined: 13 Nov 2008
Posts: 10

PostPosted: Thu Nov 13, 2008 3:25 am    Post subject: Closing active tab in firefox, else close window.. help! Reply with quote

I'm very new to AHK - I've made a few convenient scripts for myself but that's it. What I'm trying to do now is make a hotkey that will close the active tab if I'm in firefox, but outside of firefox it will close the window.

If possible, I want to be able to get the hotkey to be LButton, RButton, and !left. (!left is mapped to one of my mouse buttons) For all of the trial and error I've done so far though, I've just used ^q as my hotkey.

My major problems are figuring out how to map my preferred hotkey combination and get it to work, and how to get AHK to use that hotkey for one thing in firefox and another otherwise. If anyone can help, or even flat-out write a working script, I would be really grateful. I'll post what I have so for if you guys think it would help, but I really don't have anything yet that is even close to working.

Thanks in advance!
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Thu Nov 13, 2008 7:49 am    Post subject: Reply with quote

Check out the #IfWinActive command.
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Carlol



Joined: 14 Aug 2006
Posts: 163
Location: CPH

PostPosted: Thu Nov 13, 2008 11:27 am    Post subject: Reply with quote

To get you started it could look something like this:

Code:
#IfWinActive, ahk_class MozillaUIWindowClass
NumpadAdd::^+
Return
#IfWinActive


Meaning that plus on the numpad will send ctrl +, but only in Firefox

Good Luck and you can use AutoItWindow Info Spy to get info on windows


Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group