Wellwellwell Posted July 23, 2021 Share Posted July 23, 2021 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 Thank You~ Link to comment Share on other sites More sharing options...
Nine Posted July 23, 2021 Share Posted July 23, 2021 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. Wellwellwell 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Wellwellwell Posted July 23, 2021 Author Share Posted July 23, 2021 Thanks Nine, I will try the suggested solution and report back. Link to comment Share on other sites More sharing options...
Solution Wellwellwell Posted July 29, 2021 Author Solution Share Posted July 29, 2021 Just an update. I ended up just create a shortcut on image j to activate the imagej macro. Using send() function from autoit to activate the imagej shortcut key. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now