DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: SOLVED: Exclude firefox from script?  (Read 9,094 times)

substep

  • Participant
  • Joined in 2010
  • *
  • Posts: 6
SOLVED: Exclude firefox from script?
« on: August 03, 2010, 11: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
Code
MButton::
Send !{F4}
Return

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,840
    • Coding Snacks
Re: Exclude firefox from script?
« Reply #1 on: August 04, 2010, 12:05 AM »
code needs to look like this

Code
MButton::
ifwinactive, Mozilla Firefox
    return

Send !{F4}
Return
Alcohol is photoshop, bottled
Askhole - someone who ask for advice, then ignores it
"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Exclude firefox from script?
« Reply #2 on: August 04, 2010, 01:02 AM »
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
  • *
  • Posts: 6
Re: Exclude firefox from script?
« Reply #3 on: August 04, 2010, 01:54 AM »
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

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: Exclude firefox from script?
« Reply #4 on: August 04, 2010, 01:59 AM »
Add this line to the top of your script:

Code: (autohotkey)
SetTitleMatchMode, 2

substep

  • Participant
  • Joined in 2010
  • *
  • Posts: 6
Re: Exclude firefox from script?
« Reply #5 on: August 04, 2010, 02:04 AM »
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
    • Coding Snacks
Re: Exclude firefox from script?
« Reply #6 on: August 04, 2010, 02:14 AM »
Put a tilde character before the MButton like this
~MButton::

That prevents the program "eating" the hotkey.

substep

  • Participant
  • Joined in 2010
  • *
  • Posts: 6
Re: Exclude firefox from script?
« Reply #7 on: August 04, 2010, 02:17 AM »
Thanks 2 all, It's fine now :up:

Original address: https://www.donationcoder.com/forum/index.php?topic=23632.0