Jump to content

Acrobat Menus & WinMenuSelectItem


Recommended Posts

Another newbie here. I'm really excited with the prospects, but the excitment is tempered with reality:

I can't get WinMenuSelectItem to execute a menu item in Acrobat v 8.0.

I have tried the WinMenuSelectItem code with both "&File" as well as "File". Neither work.

Has anyone come up with a way of running menus in Acrobat v8.0?

Here is my code:

run("C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe")

WinWaitActive( "Adobe Acrobat Professional")

Send( "^o")

WinWaitActive( "Open" , "File &name:" )

ControlSend( "Open" , "File &name:" , "Edit1", "H:\Data\Archives\Investing\WmBlair\TLP\Statement TLP Blair 200703.pdf")

ControlClick( "Open" , "File &name:" , "Button2" )

WinWaitActive( "Statement TLP Blair 200703.pdf - Adobe Acrobat Professional")

WinMenuSelectItem( "Statement TLP Blair 200703.pdf - Adobe Acrobat Professional" , "" , "File" , "Expor&t" , "XML 1.0" )

WinWaitActive( "Save As" , "File &name:" )

ControlClick( "Save As" , "File &name:" , "Button2" ) ; Save with default file name

Basically, I am trying to automate opening a pdf and exporting it as XML so I can do further data extraction from it.

Here is what I see with AutoIT Window Info when the mouse is on the menu bar:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Statement TLP Blair 200703.pdf - Adobe Acrobat Professional

Class: AcrobatSDIWindow

Size: X: -1 Y: 2 W: 507 H: 733

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 199 Y: 34

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xDE6B0E Dec: 14576398

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

AVToolBarHostView

AVInternalDocumentView

AVSplitterView

AVDocumentWrapperView

AVTableContainerView

AVTabStripView

AVTabStripView

AVSplitterView

AVSplitationPageView

AVSplitterView

AVScrolledPageView

AVScrollView

AVTableContainerView

11.00 x 8.50 in

AVSplitterDragView

AVPageView

AVToolBarEasel

AVToolBarEasel

AVToolBarEasel

AVToolBarEasel

AVToolBarEasel

41%

1

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

AVDockableHostView

AVDockableHostView

AVDockableHostView

AVDockableHostView

AVRulerView

AVRulerView

AVNullDocView

Link to comment
Share on other sites

If WinMenuSelectItem() is not working then it's probably non-standard (ala Microsoft) menu which is in fact Toolbar control.

Search forum there are some posts about that (ToolBar and menu).

As I can remember in Auto3Lib is some example about that too.

Solution found: Replace WinMenuSelectItem with send( "keys" )

Send( "{ALT down}ft{ALT up}{DOWN 2}{ENTER}" ) ; File >> Export >> XML 1.0

Note: I tried the following first, but releasing the ALT key between ALT-f and ALT-t doesn;t work.

Send( "!f!t{DOWN 2}{ENTER}" ) ; File >> Export >> XML 1.0

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...