Toggle microphone on script - jacksteraz/Radiology-AHK GitHub Wiki
AHK Scripts to control Powerscribe 360
The most requested mouse or keypad shortcuts for Powerscribe are Microphone Toggle, Next Field, and Previous Field. The keyboard shortcuts for these are F4, Tab, and Shift-Tab. So it should be easy to program a mouse key to send these keystrokes. The problem is that Powerscribe only responds to these keyboard commands when the Powerscribe browser window is active. Most of the time the PACS browser window is active and the powerscribe window is in the background. There are several ways to write a script that will activate the PS window, send the command, then activate the PACS window.
Toggle Powerscribe Microphone with IfWinActive and WinActivate commands
The goal of this script is to turn on the microphone. If the Powerscribe window is active, this is simply an F4 keypress. But, if your PACS window is active you would have to click on the Powerscribe window then press F4.
The following code accomplishes this (Xanager, 5/17/23, auntminnie.com general forum)
; Microphone Toggle
#IfWinExist PowerScribe
+F3::
KeyWait, Shift, T2
IfWinActive PowerScribe
{
Send, {f4}
}
else
{
MouseGetPos,,, id
WinGetTitle, title, ahk_id %id%
If title contains PowerScribe
{
WinActivate PowerScribe
Send, {f4}
}
else
{
WinActivate PowerScribe
Send, {f4}
WinActivate ahk_id %id%
}
}
return
#IfWinExist
WinActivate command with MouseClick to return to PACS
Another example (T1 or T2, 5/4/22). Author note: "This short script basically focuses on PS360, sends a Tab, then clicks the mouse to get the attention back on pacs where I am scrolling. Since the PACS window changes with each study I had to use the mouse click trick."
Nextfield()
{
WinActivate, PowerScribe 360
Send, {Tab}
MouseClick, left
}
Using ControlSend command for "Next Field" in Powerscribe
Others (Xanager 5/8/19) have suggested using the ControlSend command as shown in the following example. The version string, 10.RICHEDIT50W.app.0.3ce0bb8_r13_ad11 in the command below changes when Powerscribe is updated. You can use the Windows Spy applet to get the version string. [Xanager and beprotis (8/3/19) mentioned that ControlSend has trouble sending the F keys.]
; Next Field
#IfWinExist PowerScribe
+F1::
IfWinActive PowerScribe
{
SendInput, {tab}
}
else
{
ControlSend,WindowsForms10.RICHEDIT50W.app.0.3ce0bb8_r13_ad11, {Tab}, PowerScribe
}
return
#IfWinExist
Another example using ControlSend
Still another example for Next Field and previous field powerscribe commands (bald, 5/3/22)
F13::ControlSend, WindowsForms10.RICHEDIT50W.app.0.26ac0ad_r7_ad11, +{tab},ahk_exe Nuance.PowerScribe360.exe
F14::ControlSend, WindowsForms10.RICHEDIT50W.app.0.26ac0ad_r7_ad11, {tab},ahk_exe Nuance.PowerScribe360.exe
Another auntminnie forum member (knightrider 2/11/19) suggested the following script for PS360
!d:: {
; turn mic on / off by pressing alt + d
winactivate ahk_class WindowsForms10.Window.8.app.0.26ac0ad_r11_ad1 ;
sleep 500
send {f4} ; Send, {ALT DOWN}{TAB}{ALT UP}
return
}
!s:: {
; send powerscribe to the next field by pressing alt + s
winactivate ahk_class WindowsForms10.Window.8.app.0.26ac0ad_r11_ad1 send {tab} ;Send, {ALT DOWN}{TAB}{ALT UP}
return
}
!a:: {
; move powerscribe to the previous field by pressing alt + a
winactivate ahk_class WindowsForms10.Window.8.app.0.26ac0ad_r11_ad1Send, +{tab}; Send, {ALT DOWN}{TAB}{ALT UP}
return
}
Using variables to save the powerscribe version strings
Nighthawker, 5/4/22 posted "ControlSend is a better solution because many PACS break scrolling, etc. when the window focus changes.
In response to the above poster, I would figure out the control names at your various hospitals, put them in a variable in your AHK file and just comment in/out the relevant ones for your work environment that day. These are the two most common ones that come up for me." (The semicolon comments out/deactivates the code on that line)
pscontrol := "WindowsForms10.RICHEDIT50W.app.0.26ac0ad_r7_ad11"
; pscontrol := "WindowsForms10.RICHEDIT50W.app.0.32f6d92_r7_ad11"
Next:
if WinActive("Reporting")
Send {Tab}
else
ControlSend, %pscontrol%, {Tab}, Reporting
Return
Use ControlSend without Windows Spy
JohnThomasSign, 9/30/21 posted this function. "At my group, the Control ClassNN changes frequently (every 1-2 months). Figured I'd throw this workaround into the knowledge-base in case it helps anyone out in the future (and prevents them from having to go into WindowSpy to update the code every time). Basically, the first time you press the hotkey for next or previous field, it will cycle through all of the controls in Powerscribe until it finds one that matches the beginning portion of the report control (which does not change) and then stores that as the control for subsequent presses. May lag for a second or two the first time you do next/prev field, but after that it's pretty snappy."
global control
XButton1::
If !control
getControl()
ControlSend, %control%, {Tab}, ahk_exe Nuance.PowerScribe360.exe
return
XButton2::
If !control
getControl()
ControlSend, %control%, {Shift down}{Tab}{Shift up}, ahk_exe Nuance.PowerScribe360.exe
return
getControl() {
WinGet, ListOutputVar, ControlList, ahk_exe Nuance.PowerScribe360.exe
RegExMatch(ListOutputVar, "WindowsForms10.RICHEDIT50W.app.0.[\w\d_]+", control)
}
ControlClick Command Example
From JohnThomasSign, 3/15/20. " This will only work if the PowerScribe window is NOT minimized (but does not have to be the active window). You also have to have that toolbar at the top of PowerScribe with the record, prev, next, etc. buttons. Note, that I use ScrollLock to toggle on/off (I assign ScrollLock to a mouse button), but any button can be used instead."
ScrollLock::
ControlClick, Speech, ahk_exe Nuance.PowerScribe360.exe,, left, 1, x20 y20
return
Also see Xanager setup 5/30/2018: https://www.auntminnie.com/Forum/tm.aspx?m=540180&high=onboard+memory