Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
( this is only one of many, and this seems to be a thing in music production programs )
It does not seem to respond to any commands https://vmpk.sourceforge.io/#Download
I am assuming after figuring this one out, the other ones start to work as well
All your help is much appreciated
It does not seem to respond to any commands https://vmpk.sourceforge.io/#Download
I am assuming after figuring this one out, the other ones start to work as well
All your help is much appreciated
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
It's a Qt app, so regular AHK methods won't work with it. One way would be to use ImageSearch, FindText, or other image-finding methods to locate elements and click.
Another way would be to use UIAutomation. For example, download UIA_Interface.ahk from the provided link and put it in the same folder as the following script:
Another way would be to use UIAutomation. For example, download UIA_Interface.ahk from the provided link and put it in the same folder as the following script:
Code: Select all
#include UIA_Interface.ahk
WinActivate Virtual MIDI Piano Keyboard
UIA := UIA_Interface()
vmpk := UIA.ElementFromHandle("Virtual MIDI Piano Keyboard")
channelRange := vmpk.FindFirstByName("Channel:").FindByPath("+1") ; Finds the label named "Channel" and then gets the next element which is the actual range element
channelRange.Highlight()
channelRange.Value := 2
vmpk.FindFirstByName("Reset All").Highlight().Click() ; click the Reset All button
ExitApp
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
thank you, did not understand how to make it work thoughDescolada wrote: ↑27 May 2023, 01:30It's a Qt app, so regular AHK methods won't work with it. One way would be to use ImageSearch, FindText, or other image-finding methods to locate elements and click.
Another way would be to use UIAutomation. For example, download UIA_Interface.ahk from the provided link and put it in the same folder as the following script:Code: Select all
#include UIA_Interface.ahk WinActivate Virtual MIDI Piano Keyboard UIA := UIA_Interface() vmpk := UIA.ElementFromHandle("Virtual MIDI Piano Keyboard") channelRange := vmpk.FindFirstByName("Channel:").FindByPath("+1") ; Finds the label named "Channel" and then gets the next element which is the actual range element channelRange.Highlight() channelRange.Value := 2 vmpk.FindFirstByName("Reset All").Highlight().Click() ; click the Reset All button ExitApp
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
thank you, one thing about github... um, is there any instructions how and where to place a file anywhere on github ?
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
and thanks again, checking the wikiJuicyT wrote: ↑01 Jun 2023, 01:23thank you, one thing about github... um, is there any instructions how and where to place a file anywhere on github ?
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
Installing Autohotkey created a folder in "C:\Documents". In that folder I have two other folders called Lib and Scripts. UIA is in Lib and UIAViewer in Scripts. In a script, I can call the library using #Include <UIA_Interface>.
Does this answer your question?
Does this answer your question?
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
Hi there, yeas it does thank you
I am wondering what am i doing, or not doing, when as soon as i press f1, this message comes up ( running the UIAVieiwer in the folder )
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
I've got no idea. It works fine for me. Are you sure if you have both complete scripts? If you do then I guess you just have to ask @Descolada.
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
Thank you, yes they are in the same directory
or just to double check, what scripts do you mean are in the same directory or not ?
Re: Can somebody tell me how could i automate anything on this program ( virtual midi keyboard ) ?
I'll give you an example of a library is scripted the same directory:
C:\Users\LPIII\OneDrive\Documents\Autohotkey\Lib\UIA.ahk
C:\Users\LPIII\OneDrive\Documents\Autohotkey\AHK Scripts\Apps\YouTube.ahk
When you have the library in this directory, called the User library, you can include the library in scripts with #Include <UIA_Interface>.
C:\Users\LPIII\OneDrive\Documents\Autohotkey\Lib\UIA.ahk
C:\Users\LPIII\OneDrive\Documents\Autohotkey\AHK Scripts\Apps\YouTube.ahk
When you have the library in this directory, called the User library, you can include the library in scripts with #Include <UIA_Interface>.