Skip to content

Instantly share code, notes, and snippets.

@ahri
Created January 6, 2012 10:10
Show Gist options
  • Select an option

  • Save ahri/1569961 to your computer and use it in GitHub Desktop.

Select an option

Save ahri/1569961 to your computer and use it in GitHub Desktop.
Python code to watch Visual Studio, and tell it to reload stuff when it inevitably has a hissy-fit because my awesome git-tfs setup has changed everything it knows about the world.
from pywinauto.application import Application
from pywinauto.findbestmatch import MatchError
app = Application.connect(path="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe")
while True:
try:
app.FileModification.Reload.Click()
except MatchError:
pass
try:
app.UnableToAccessDatabase.OK.Click()
except MatchError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment