-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jumping between davinci resolve and the "save as..." Window. #19
Comments
Hello,
The tricky part will be getting the dialog to save to a specific location. I'm not sure what the dialog looks like in Win 11, but in Win 10 it would likely require clicking a button at the topmost toolbar and then waiting for an edit element to appear... |
Well I have tried similar thing before, but even just sending a MsgBox("Test") to see if it was responding didn't make the MsgBox to appear, I tried to add it right after clicking the Export subtitle element, but the message box was appearing only after I did save, manually, the file. So as of how you wrote the code snippet you gave me, I think it would indefinitely wait or the element Export Subtitle from the resolve.exe file, but will never find it, except if I was to open back the same page by myself (and I'm not even sure if it would work) |
The code snippet I gave you would not infinitely wait anything, because WinWait has the timeout argument specified. Your code snippets last working part |
So I've tried to use your snippet another time and, waiting enough time in the "Export Subtitle" window, it will show up an error message from ahk being the following :
"Sous titres majuscules" being the name of the project I actually work on, and the line 19 being the line of when the script clicks the "Export Subtitle..." element. If I use alt tab to check if there is any ahk window, there is none giving me an error, and none being my "test windows" that I create with MsgBox. If I click fast enough (in something around 5 seconds) manually on the Export window to save or cancel, it will trigger the even where Winwait wasn't found, and so return, only after I click (I checked that by using a specific MsgBox() to see if it was appearing. From all that points, I suppose that it waits for the window to be closed as a sort of "confirmation" but it means that I can't click anything on it, and it was for that I tried to come ask you for any ideas right there |
That's what I get for not actually testing it beforehand! You are correct, it doesn't work and hangs. The reason is that the Export Subtitle dialog is a modal window and in some broken implementations of Invoke/DoDefaultAction (which Click uses internally) these hang until the modal window closes. If Invoke is properly implemented then it should return immediately, however I've encountered this kind of "hanging" before: the same problem is discussed in the UIA-v2 thread. As a workaround I propose to use |
Sorry, I am not a great user of github, and the tool I was using on Davinci had an update about what I wanted to do with the AHK + UIA script I was writting, so I did not try more than that as it was quite complicated to make it run, I am not sure of how exactly I should state the issue here, in anyways, I'll keep in mind that Element.ControlClick() for the next time I come back to the project to make a few new automations ! Thanks for your time. |
So, I've been looking at the documentation of this fantastic tool you've made and wanted to make a ahk script using UIA v2, I've been doing well, going step by steps, from starting my script by a right click, that allows me to click on "export subtitle" on Davinci Resolve, but I believe I'm blocking right there due to a big thing that I have trouble handling, even after searching on the forum and the documentation.
When I make my script click the "export subtitle", it works great, and sends me to the file explorer for me to choose where I want to export my subtitle to, and I wanted my script to click by itself on the 'save' button, and keeping a few variables like the location of the file, and I've found that it does not execute the lines coming after it clicks on "export subtitle", so I wanted to know if you have any ideas on how to go through that and to make my idea work. Thanks you very much !
(The whole idea is to export the script, and then edit it to make it all caps, and then import it back to Resolve, so the subtitles are capitalized. Of course, I am planning to finish the rest of the code myself, but I'm stuck at this windows pop up.)
Here is the code in case it helps you troubleshoot:
Specification precision, I am on the latest ahk and uia versions, and running on Windows 11, in case it can be due to that. (not the ahk alpha version)
The text was updated successfully, but these errors were encountered: