Wellwellwell Posted July 23, 2021 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~
Nine Posted July 23, 2021 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Wellwellwell Posted July 23, 2021 Author Posted July 23, 2021 Thanks Nine, I will try the suggested solution and report back.
Solution Wellwellwell Posted July 29, 2021 Author Solution 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.
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