Bind the script to a keyboard shortcut, e.g. SUPER+S for Sublime, SUPER+B for Browser, etc. The script switches between all the app windows that match given pattern. Remembers last active window for each pattern.
Python 2.7, wmctrl, xprop
python switcher.py sublime_text