How to handle mac or windows os application in matlab?
1 view (last 30 days)
Show older comments
ali mahdi
on 7 Jan 2016
Answered: Walter Roberson
on 8 Jan 2016
I am trying to implement an auto clicker that automatically click mac or windows os applications. For instance, safari or any other installed application. How can I call the handles of the targeted application into matlab?
0 Comments
Accepted Answer
Walter Roberson
on 8 Jan 2016
Applications do not have handles.
In MS Windows, windows have handles, and those windows are associated with an application.
You might have to take care to trace back from a handle to a window to the primary window; I have seen code for this in C but I do not recall if I have seen MATLAB or Java code for it.
For Linux, if you are using X, then have a look at http://stackoverflow.com/questions/30156202/xlib-c-get-window-handle-sendevent
But it might be different for GDK. You can compare some of the techniques cross-platform at https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Finding_Window_Handles
Modern OS-X does not use X.
However, remember that getting the handle is an implementation detail and is not necessarily the best approach to raising the application to the front so that you can use Java Robot class. To raise an application to the front in OS-X you can use applescript commands
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!