Jump to content

Autoit WinMenuSelectItem not working on ImageJ


Go to solution Solved by Wellwellwell,

Recommended Posts

Hi,

I have a function below:

Func CheckmagethroughImageJ()
   WinActive("ImageJ")
   Sleep(50)
   $isdone = WinMenuSelectItem("ImageJ", "", "File", "Quit")
   MsgBox(0,"Notice","complete action?:" & $isdone)
EndFunc

The function is simple, it will select the menu on ImageJ -> Press "File" -> Press "Quit"

I have tried WinMenuSelectItem open Notepad and it could work, also able to open a self made application.

However, The WinMenuSelectItem() does not work in Imagej, or anyone know any alternate way?

 

*ImageJ are opensource image processing application

I also tried added "&" on the file, it still could not open.

$isdone = WinMenuSelectItem("ImageJ", "", "&File", "Quit")

Snipshot of menu that i want to open

 

image.png.05fedbc66004248673e3de10b031bf6d.png

Thank You~

image.png

Link to post
Share on other sites

In help file under WinMenuSelectItem :

Quote

WinMenuSelectItem() will only work on standard menus. Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications.

Try using _GUICtrlMenu_GetMenu and the other functions to parse the actual text of the menu.  If you cannot grasp the text then you will have to use UIAutomation.

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