• SONAR
  • [SOLVED] Keyboard shorcut to "Show/Hide Track" in PRV? (p.2)
2016/11/18 08:24:03
rogeriodec
After some time, I decided to create a script myself, to work around this problem, using Autohotkey.
It basically looks for the color of the active track within the PRV. Important: the color it looks for is #cfeffa (Sonar default theme); If you use another theme, change the color of the active track within this script.
And also, for the sake of ergonomics, I remaped the "E" key to perform this function. So this script will intercept this key and it will not have another function inside Sonar.
 

SetTitleMatchMode RegEx
#IfWinActive, ahk_exe i)SONAR.*exe
 
e:: ; Pressing "E" in Piano Roll View, shows only the current track and hide all others
IfWinNotActive, Piano Roll
{
send e
Return
}
ControlGetPos, x, y, w, h, ListBox1
PixelSearch, Px, Py, %x%, %y%, (x + w), (y + h), 0xcfeffa, , fast RGB
if ErrorLevel
{
MsgBox, Active track not found. Select one track in PRV.
return
}
Send, h ; hide all tracks on prv
MouseMove (Px - 38), (Py + 8) ; pos over "show/hide" button
Click
MouseMove xx, yy ; recover original mouse position
Return
 

2016/11/18 18:37:59
Brando
That's a clever solution. Well done.
2016/11/22 19:25:30
rogeriodec
I did a little fix in the script on post #11, which is now updated.
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account