How to handle mac or windows os application in matlab?

2 views (last 30 days)
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?

Accepted Answer

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

More Answers (0)

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!