I was hoping that somebody may have some input for me. I have need to run an AHK script on several different machines. They're all built similarly with the same software, but the window handles seem to be different. In the testing that I did when I wrote the script initially, the handles were the same and it work. I then distributed the script to a fellow staff member and the script failed. I believe that it has to do with the handles. I could be wrong, but I'm going with this theory for now.
So...
Code: Select all
WinActivate, ahk_class WindowsForms10.Window.8.app.0.26ac0ad_r14_ad1 ahk_exe Nuance.PowerScribe360.exe ; activate the window
Sleep, 150
Click, 247, 163 Left, 1 ; left click in the report edit control (this works a bit better than 'controlsettext' commands, which were causing PowerScribe to misbehave on this particular step.
Sleep, 2000 ; give the mouse a short amount of time to move in case the pointer is 3 screens away
Send, {Control Down}{a}{Control Up} ; select all
Sleep, 150
Send, {Delete} ; clear the existing text, if any
Sleep, 150
'Report' variable
ControlSetText, WindowsForms10.RICHEDIT50W.app.0.26ac0ad_R14_ad11, %Report%, ahk_class WindowsForms10.Window.8.app.0.26ac0ad_r14_ad1 ahk_exe Nuance.PowerScribe360.exe ; replace the text in the powerscribe window with the contents of 'Report' variable
What I would like to do is try and make this more generic. I want to just use ahk_exe to identify the application and then I need some way to identify the control within it. Does anyone know how to do this?