Charles Steyn wrote:
Today I spent a few hours trying to modify my copy of the SelectText
script to work in Visual Studio. I used the Immed script to try and get
text from the Visual Studio editor without any success.
Print focusedwindow.control.text yields nothing although this works in
other editors such as notepad.
That's because this isn't a standard control, so it doesn't support the
standard control methods and properties (like .Text).
The NativeObjectModel property does not work at all for vS.
That's completely up to Microsoft. So far, the only windows we've found
that support the NativeObjectModel are some Microsoft Office
applications (Word, Excel, Powerpoint), and rich edit controls. There
may be others, but that's about it.
After experimenting with the Children.FilterByName method I eventually
tried the following:
print ActiveWindow.Children.FilterByName("text editor")(1).Control.Text
This only yields "text editor" the same as the window name and type.
That's really no different than doing the FocusedWindow.Control.Text
method you tried. Since it's not a standard edit control, you won't be
able to get text using the Control object of that window.
Is it possible to get and select text with the WE object model or should
I rather look at the Visual Studio object model for this functionality?
If the Studio OM already has that functionality, then it would be
quicker to take advantage of it. That being said, you can get all of the
clips in that window, and determine which ones are selected. There are
caveats to that, like when text scrolls off the screen and such, but
with some work, it can be done.
Aaron
--
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.
Aaron Smith
GW Micro
Phone: 260/489-3671
Fax: 260/489-2608
WWW: http://www.gwmicro.com
FTP: ftp://ftp.gwmicro.com
Technical Support & Web Development