Jump to content

Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...