topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 12:13 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Exclude firefox from script?  (Read 6569 times)

substep

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 6
    • View Profile
    • Donate to Member
SOLVED: Exclude firefox from script?
« on: August 03, 2010, 06:31 PM »
I have a script to close windows by middle click but I want it not to work in firefox. Is that possible?
Script is
MButton::
Send !{F4}
Return

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #1 on: August 03, 2010, 07:05 PM »
code needs to look like this

MButton::
ifwinactive, Mozilla Firefox
    return

Send !{F4}
Return

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #2 on: August 03, 2010, 08:02 PM »
Also it's a good idea to avoid a window with the title
Program Manager

which is the desktop. Otherwise if there's nothing else open on the desktop it may ask you if you want to log off. :)

substep

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 6
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #3 on: August 03, 2010, 08:54 PM »
code needs to look like this
thx, but it works only if the window title is exactly "Mozilla Firefox", it puts tab names before it.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #4 on: August 03, 2010, 08:59 PM »
Add this line to the top of your script:

Code: Autohotkey [Select]

substep

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 6
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #5 on: August 03, 2010, 09:04 PM »
Add this line to the top of your script:
It works now, but now middle-click in Firefox itself stopped functioning

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #6 on: August 03, 2010, 09:14 PM »
Put a tilde character before the MButton like this
~MButton::

That prevents the program "eating" the hotkey.

substep

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 6
    • View Profile
    • Donate to Member
Re: Exclude firefox from script?
« Reply #7 on: August 03, 2010, 09:17 PM »
Thanks 2 all, It's fine now :up: