View Single Post
Old 11-24-2020, 12:48 PM   #5
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Quote:
Originally Posted by shosty View Post
How do you find this? I've had a similar problem with the midi learn last touched parameter, I would like to assign it to a button so I can press it, midi learn and the dialog closes but I can't find a way to press OK/enter as an action.
If you know for sure there is only one child window on the parent window with exact text, lets say its "OK", or "ok" (case doesn't matter) then you can safely use JS_Window_FindChild() to get its handle, for example,..
Code:
btn = reaper.JS_Window_FindChild(parent, "OK", true)
Note that some dialogs can block scripts from running, if you need more help post image(s) of the exact window(s) you're referring to.
Edgemeal is offline   Reply With Quote