How to script Visual Studio 2008 from Python?
Question: I'd like to write Python scripts that drive Visual Studio 2008 and Visual C++
2008. All the examples I've found so far use `win32com.client.Dispatch`. This
works fine for Excel 2007 and Word 2007 but fails for Visual Studio 2008:

    
    
    import win32com.client
    app1 = win32com.client.Dispatch( 'Excel.Application' ) # ok
    app2 = win32com.client.Dispatch( 'Word.Application' )  # ok
    app3 = win32com.client.Dispatch( 'MSDev.Application' ) # error
    

Any ideas? Does Visual Studio 2008 use a different string to identify itself?
Is the above method out-dated?


Answer: Depending on what exactly you're trying to do,
[AutoIt](http://www.autoitscript.com/autoit3/index.shtml) may meet your needs.
In fact, I'm sure it will do anything you need it to do.

Taken from my [other post](http://stackoverflow.com/questions/151846/get-
other-running-processes-window-sizes-in-python#155587) about how to use AutoIt
with Python:

    
    
    import win32com.client
    oAutoItX = win32com.client.Dispatch( "AutoItX3.Control" )
    
    oAutoItX.Opt("WinTitleMatchMode", 2) #Match text anywhere in a window title
    
    width = oAutoItX.WinGetClientSizeWidth("Firefox")
    height = oAutoItX.WinGetClientSizeHeight("Firefox")
    
    print width, height
    

You can of course use any of the [AutoItX
functions](http://www.autoitscript.com/autoit3/docs/functions.htm) (note that
that link goes to the AutoIt function reference, the com version of AutoIt -
AutoItX has a subset of that list...the documentation is included in the
download) in this way. I don't know what you're wanting to do, so I can't
point you towards the appropriate functions, but this should get you started.

