Here is the latest version of an ahk script I call "metagroup". What it does is this. You use the combos, ctrl+numpad1-3 to move among groups of things.
In this case, ctrl+numpad1 (tapped repeatedly) cycles through all your open text files (or text related: Word and WordPad e.g.). Notepad, MetaPad, NotePad++, and a secure-notes program called LockNote are *also* grouped in the "texts" category. Some of these programs won't be on your system, and so won't apply to you.
Ctrl+numpad2 cycles through all "folders"-related items including single folders, Explorer dual-panes, Xplorer², Q-Dir (if you have that program on your system), and Everything Search (again, if you use that tool for local searches).
Ctrl+numpad3 (again, tapped repeatedly) goes through all programs grouped under "browsers". For this script, Firefox, IE, Chrome, and Opera are the switchables.
Finally, Ctrl+numpad4-6 close down all "texts", "folders", and "browsers" respectively. For "texts", you are prompted to save your work if you haven't save the latest changes.
Of course you can change the key combinations, add to the groups, take some away, and make groups of your own. E.g. You could have a group called "media", under which might reside Winamp, Media Player, VLC, Foobar, etc. You would tap their combo repeatedly to switch among them, or tap another combo to shut them all down at once. What you'd want that for, is hard to say, but who knows.
Along with Autohotkey itself, you will want to use its "spy" tool to find what active-window names and or titles your programs report to AHK. Those names you would then use when you add them to a group.
There is much more on using "groups" in Autohotkey here:
Process, Priority, , High
GroupAdd, texts, ahk_class metapad
GroupAdd, texts, ahk_class Notepad
GroupAdd, texts, ahk_class Notepad++
GroupAdd, texts, ahk_class WordPadClass
GroupAdd, texts, ahk_class OpusApp ; Word
GroupAdd, texts, ahk_class ATL:0044B1A0 ; LockNote
GroupAdd, folders, ahk_class ATL:ExplorerFrame ; Xplorer²
GroupAdd, folders, ahk_class CabinetWClass ; folder
GroupAdd, folders, ahk_class EVERYTHING ; Everything Search
GroupAdd, folders, ahk_class ATL:0000000140122AE0 ; Q-Dir
GroupAdd, browsers, ahk_class MozillaWindowClass ; Firefox/Seamonkey
GroupAdd, browsers, ahk_class IEFrame ; Internet Explorer
GroupAdd, browsers, ahk_class Chrome_WidgetWin_1 ; Chrome
GroupAdd, browsers, ahk_class Chrome_WidgetWin_0 ; Opera
; Assign hotkeys to activate these groups, which will cycle
; through all open instances of metapad/notepad/notepad++,
; Word, folder windows, and Firefox/IE/Chrome/Opera browsers, one at a time
; (i.e. at each press of their respective hotkey). Control
; plus a number-pad key are used in this example.
#WinActivateForce ; see here http://www.autohotkey.com/docs/commands/…
~$^numpad1::GroupActivate, texts, r ; go through opened text files
~$^numpad2::GroupActivate, folders, r ; go through opened folders
~$^numpad3::GroupActivate, browsers, r ; go through opened browser windows
; close all text files, all folders, and all instances
; of IE, Firefox, Chrome, and Opera.
GroupClose, texts , A
GroupClose, folders , A
GroupClose, browsers , A