pdenize Posted February 12, 2007 Share Posted February 12, 2007 I've been driving applications with Autoit for a few months via Ruby scripts. However I reciently got stumped after upgrading to IE7. I'm trying to drive the menu to do an Alt-V-C (View source). I know I can ask for it from the DOM its just that IE screws with the source too much via that path. title = "AutoIt Forums" $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.ControlSend("#{title}", "", "", "!VC") # Alt View sourCe What apperars to be happening is; - the menu bar appears (in IE7 its obscured till Alt is pressed) - the view menu appears - then the menu bar disappears, the view menu is still visible, and the source item is not selected. Typing c at this point does seem to work. Using the Window info tool it appears not to be a seperate window or anything silly. I tried delays between characters but nothing has worked. Any hints ? Link to comment Share on other sites More sharing options...
Bert Posted February 12, 2007 Share Posted February 12, 2007 try WinMenuSelectItem The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
pdenize Posted February 12, 2007 Author Share Posted February 12, 2007 Thanks for the heads up on that function. Both methods work in other apps and IE6 but IE7 has these stupid menubars that appear and disappear and dont seem to respond the same.try WinMenuSelectItem Link to comment Share on other sites More sharing options...
pdenize Posted February 13, 2007 Author Share Posted February 13, 2007 Found a solution $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.ControlSend("#{title}", "", "", "!V") # Alt View $autoit.Send("C") # sourCe Seems the C gets lost somehow if the window title is sent (as per below) ... $autoit.ControlSend("#{title}", "", "", "C") # sourCe If anyone has a CLEANER solution I'd love to see it. Meanwhile this will work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now