Jump to content

Newbie right-click-popup-menu question...


 Share

Recommended Posts

Folks,

I'm new to AutoIT and have run into a situation where I need advice from more experienced users. I'm trying to automate a procedure, but my script stalls when I attempt to programmatically access a right-click popup menu. The menu does open, but I haven't been able to proceed any further. I've included here 3 pieces of information - the AutoIT Macro Generator output script for the procedure I'm trying to script, the AutoIT Window Info Summary output for the right-click popup menu, and a screenshot of this popup menu.

Here's what I'm asking: can you determine whether or not this is something that AutoIT can automate? If so, can you steer me towards the tools that I should study to pursue this further? I'll do my homework, but I'll need some help narrowing the scope of my focus.

PS: yes, I've noted the "AutoIt supports no Popup menus and Special menus" comment in the Macro Generator's output. I just don't know if this is a "terminal" situation, or whether there's more advanced strategies that AutoIT can bring to bear on this.

Thanks! The screenshot is attached, and the Macro Generator output and the Window Info Summary are listed below...

------------------ The Macro Generator Output ----------------------------

#region --- AutoIt Macro Generator V 0.21 beta ---

Opt("WinTitleMatchMode", 4)

WinWait("Untitled - SketchUp Pro","")

WinMenuSelectItem("Untitled - SketchUp Pro","","Plugins","Andersen® Windows Components","Create a new component")

WinWait("Window Studio® - [sketchUp Design (Workbench)]","SketchUp Design (Workbench)")

WinMenuSelectItem("Window Studio® - [sketchUp Design (Workbench)]","SketchUp Design (Workbench)","&Products","Insert 400 Series Unit","Woodwright® Double-Hung Windows","Double-Hung Unit")

ControlClick("Window Studio® - [sketchUp Design (Workbench)]","SketchUp Design (Workbench)","AfxFrameOrView902")

ControlClick("Window Studio® - [sketchUp Design (Workbench)]","SketchUp Design (Workbench)","AfxFrameOrView902","Right")

;AutoIt supports no Popup menus and Special menus

WinWait("Unit Properties","Woodwright Double-Hung Win")

ControlCommand("Unit Properties","Woodwright Double-Hung Win","ComboBox1","SelectString,"WDH18410")

ControlClick("Unit Properties","Woodwright Double-Hung Win","Button5")

ControlClick("Unit Properties","Woodwright Double-Hung Win","Button3")

#endregion --- End ---

------------------ the Window Info Summary -------------------------------

>>>> Window <<<<

Title:

Class: #32768

Position: 317, 292

Size: 153, 211

Style: 0x94800000

ExStyle: 0x00000189

Handle: 0x00000000004908DE

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Name:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 411, 488

Cursor ID: 2

Color: 0x3399FF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

post-62571-0-32028900-1295745319_thumb.j

Link to comment
Share on other sites

Here's what I'm asking: can you determine whether or not this is something that AutoIT can automate? If so, can you steer me towards the tools that I should study to pursue this further? I'll do my homework, but I'll need some help narrowing the scope of my focus.

How exactly are you stuck? Are you showing the menu, but not sure where to go from there?

Have you tried using the Send function to send up or down arrow keys to highlight the item of choice and then send {ENTER}.

e.g.,

;; after you've opened the pop-up menu...

Send({DOWN 2})
SEND({ENTER})

You may be better off though using a hot key of the program though if one is available.

Link to comment
Share on other sites

Fubarable,

I've worked it out - after following your suggestion of using the Send function and hot-key methods. After re-writing the script, I found that if I just nudged the mouse into the interior of the popup menu, then I could use {DOWN} commands to make my selection. Prior to doing this my cursor manipulation commands were being ignored.

Again, THANKS!

Edited by Aid2Kids
Link to comment
Share on other sites

Varian,

Thank you for your reply!

>> ...one of the controlcommand() lines is missing a quotation around selectstring <<

Yes, I did notice that, and I had indeed corrected earlier when I was first experimenting. I forgot to correct it in the text that I posted. The Macro Generator is definitely leaving out the quotes; it does this every time I run it for this procedure.

BTW: I'm in NC as well.

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...