Sign in to follow this  
Followers 0
gli1

Pull Down Menu Selection

8 posts in this topic

Hi all,

I'm using SciTE4 to write an AutoIt3 script. A hot key is sent to get the selection on top of the menu, and a pull down menu appears. The next thing is to choose one of the items on the pull down menu. There are no hot keys on the pull down menu. The Class names / Instance names by Au3Info are identical, with the only difference is "ControlClick Coords".

My question is how do I make a pull down menu selection. By the way, it seems like that WinMenuSelectItem() is not working with this GUI application.

Thanks,

gli1

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Are you trying to automate SciTE4? I get WinMenuSelectItem in SciTE4 with Macro Recorder. If SciTE4, then what are menu are you selecting?

Edited by Varian

Share this post


Link to post
Share on other sites

Thanks Varian!

Yes, I'm using SciTE4. Sorry for my ignorance, what the "Macro Recorder" is?

The top menu in this GUI application starts with File, Edit, Project, ... WinMenuSelectItem() returns a 0:

If Not WinWaitActive("the application", "", 16 ) Then
    MsgBox(0, @ScriptName, "the application is inactive in 16 seconds")
    Exit
EndIf

If WinMenuSelectItem( "the application", "", "&File" ) == 1 Then
    MsgBox(0, @ScriptName, "File selected" )
Else
    MsgBox(0, @ScriptName, "File not selected" )
EndIf

Share this post


Link to post
Share on other sites

Actually I meant Macro Generator..it is in the Program Files\AutoIt3\SciTe\AutoItMacroGenerator, or wherever you Scite folder is. If you have a full SciTe install, that is. Just search the site or Google it. Open Scite, start Macro Generator, press record, and then do the menu selections. this is what I get when I do File>Open:

Share this post


Link to post
Share on other sites

Hi Varian,

Would you please elaborate the steps to hook up AutoIt Macro Generator in to SciTE4?

I downloaded AutoIt Macro Generator V 0.21 beta. When I started, it popped up a window just like yours. I clicked the first icon on the left ( I guess its record button). I didnt get anything when I compiling the AutoIt script or running the script.

Thanks!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Press the red button (Record); Do your Menu selections in SciTe. As you do click on Windows and Controls, you will see text of your actions going into the Macro Generator window. When you are done, press the stop button (4th button), or Pause (3rd Button)..This tool is by no means perfect, but it is one of the few that does WinMenuSelectItems...When you press stop, the 5th button is the save button. You can save the snippet as a script or you can copy and paste the text in it's window to another script. It gets Window titles and text OK, but I would use the Au3Info Tool for those so that you can truly distinguish between windows.

Edited by Varian

Share this post


Link to post
Share on other sites

Hi Varian,

Thanks. I got it. Here are what caught by "AutoIt Macro Generator V0.21 beta:

; click the selection on the top menu, a pull down menu is shown
WinWait("classname=Afx:400000:800:10013:10:0","")
; click the first choice on the pull down menu
ControlClick("classname=Afx:400000:800:10013:10:0","","BCGToolBar:400000:8:10013:101")
; click the second choice on the pull down menu
ControlClick("classname=Afx:400000:800:10013:10:0","","BCGToolBar:400000:8:10013:101")
; click the third choice on the pull down menu
ControlClick("classname=Afx:400000:800:10013:10:0","","BCGToolBar:400000:8:10013:101")
; ...
; the sixth choice is the one I attempted to get in
ControlClick("classname=Afx:400000:800:10013:10:0","","BCGToolBar:400000:8:10013:101")

As you can see all the class names are the same...

ControlClick() returned a 0 when I copied/pasted to my autoit script.

Any idea how to get around it?

Thanks again!

Share this post


Link to post
Share on other sites

Hi Varian,

It turned out that the pull down menu is built using BCGToolBar (http://www.bcgsoft.com). Luckly the application allows to create hot keys. I completed my script.

BTW, the tool AutoIt Macro Generator is very helpful.

Thank you very much for your help!

Share this post


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
Sign in to follow this  
Followers 0