Create shortcut to activate window by title

How to avoid Alt-Tab

This article will show you how to create Windows shortcut to either:

  • Start new application, if it is not yet started or
  • Activate the existing window based on the window title, if the application is already running in one of the windows

Why to do that?

I hate using Alt-Tab or mouse for switching between numerous open windows. If there is too many windows and you have taskbar at the bottom of your screen, the titles of windows are even not readable as they are shortened.

How to do that?

  1. Download and install excellent automation software AutoHotKey (GNU GENERAL PUBLIC LICENSE)
  2. Create 1 AutoHotKey script for your application, f.e. firefox.ahk. Place following content:
    SetTitleMatchMode 2 ; 2 means that Firefox can be anywhere in the title
    IfWinExist, Firefox
    {
        WinActivate  ; Automatically uses the window found above.
    }
    else
    {
        run c:\apps\sit\prohlizece\firefox\firefox.exe
    }
    Exit ; This will force AutoHotKey to finish, rather than to stay in memory running
  3. Try your file by double clicking your script

You can than assign this shortcut to special keys of your keyboard, save them to the desktop or assign standard keyboard shortcut to invoke the action.

I prefer assigning them to upper row of keys of my Microsoft Natural Keyboard 4000, as this means that I can activate particular application just with single hitting the button, no additional key is required to press too.

If you have some additional tips or ideas, please leave a comment.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

1 Comment so far

  1. popoy on Září 12th, 2009

    Hi,

    I have the same keyboard and use autohotkey. How do you remap the favorites button to us your script above?

    thanks

  2. Jety on Září 24th, 2009

    Hi Popoy, I was never able to remap Favourites button (the one with star on it), when I press it it shows always “Show my favourites” window.

    I could not remap Volume up/down buttons either, but would like to do so. If you find a way, please let me know.

Opiste znaky z obrazku: