#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance force ; Replaces script (Reloads). #Persistent ; To make it run indefinitely #IfWinActive ahk_exe S:\MuseScore 3.4\bin\MuseScore3.exe ; Enables Hotkeys when MuseScore3 Window is Active #Include 34_Coordinates_02.ahk ; All needed coordinates are managed in this external file ; The Include directive causes the script to behave as though ; the specified file's contents are present at this exact position ; Replace the path S:\etc. with your location of MuseScore3.exe /* Just above this point you see this: /* These two characters and then an empty line. At the end of this section you see this: */ Again only two characters occupying the whole line. Everything between /* and */ is a comment. Comments are not read by the AHK program so don't influence the speed of execution, Another way to 'outcomment' is starting a line with a semicolon ; followed by a space. So you can use this method to write your own comments in the files. The macros in 34_Selection_02.ahk replace the manual selection via contextual menus. When you rightclick elements you find two categories: In Cat. [1] 'Select' is reached by Arrow down 8x and in Cat. [2] by Arrow down 6x. Cat. [1] contains Notes, Grace Notes, Noteheads and Rests. Cat. [2] all the rest: including Beams, Stems,Clefs, Key and Time Signatures, Brackets, Accidentals Cat. [1] -> Select -> More -> Window 'Select Notes'. Cat. [2] -> Select -> More -> Window 'Select'. These macros are 'FREE CANVAS', that means independent of the screen layout. Coordinates refer to the MINIMIZED Windows. Minimizing brings them in a reproducible state. To determine the coordinates of the MINIMIZED Windows use the tool PixelMousing. You will notice: in the macros each 'Arrow down' command gets its own line. This creates a longer responsetime and thus more stability, especially in big scores. If your scores are always small you can try to reduce the sleep times. All given coordinates work on the testscreen, resolution 1920x1080 at 93 Dots Per Inch By convention the Top Left Corner of the Screen has coordinates x=0 and y=0 Replace the numbers of the coordinates with your numbers (Use tool Pixelmousing) Some hotkeycombinations use the bracketkeys [ and ] as first key. Check if you use these keys already in customized shortcuts. As you can read in 02 AHK for MuseScore - Selection - Intro to Coordinates.pdf: Consider to redefine those MuseScore shortcuts. NB: The WinLogokey in the shortcuts is the Left Winkey. If you prefer the Right Winkey: change Keywait, LWin, u in Keywait, RWin, u */ ~[ & 1:: MsgBox, 4096 , Selection: this Info opens with [ + 1, ( Select all ELEMENTS except notes For Press plus All similar Same subtype Range Control RightButton # MidButton Score Shift RightButton MidButton Staff CapsLock RightButton MidButton Voice Alt RightButton * MidButton * Staff+Voice WinLogo RightButton MidButton Action - score, voice or staff: click an element. Action - range: don't click the element but position the mouse on it # Click an element + hotkey opens the Window Select * Also for voice in range. Action as in range Elements include Beams, Flags, Dots and Stems -------------------------------------------------------------------------------------------- Select all NOTES of the same In Score/Range In Staff Duration ] + D [ + D Pitch ] + P [ + P Notename ] + N [ + N Voice ] + V [ + V Action: Action: Select range or all and Click a note of Position mouse on note the right type (or rest for duration) Select only all noteheads or only all rests ] + H Notes include Grace Notes, Noteheads and Rests NB: More selection options with Color Search and Color Selection ) Return ; ===================== SELECT ELEMENTS == in contextual menu 6 x down ================ ; Range > all similar: Control + RightButton ~^RButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right ; executing each line takes about 30 ms Sleep, 150 ; additional sleeptime increases stability Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 350 ; increase sleeptime if needed Send {down} Sleep, 100 Send {down} Sleep, 100 Send {Enter} ; OK Sleep, 100 MouseMove, StartX, StartY ; back to original position Return ; Score > all similar: Shift + RightButton ~+RButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY Click, right Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 100 ; increase sleeptime if needed Send {Enter} ; OK Sleep, 100 MouseMove, StartX, StartY ; back to original position Return ; Range > Similar > Same voice: Alt + RightButton ~!RButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 600 ; additional sleeptime increases stability Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_04_X%, %WS_04_Y% ; Window Select Same voice Sleep, 50 Click, %WS_03_X%, %WS_03_Y% ; Window Select In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > all similar. CapsLock + RightButton. ~CapsLock & RButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {down} Sleep, 50 Send {Enter} ; OK MouseMove, StartX, StartY ; back to original position Return ; Staff > all similar > same voice. WinLogo key + RightButton #RButton:: Keywait, LWin, u Keywait, RButton, u CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_02_X%, %WS_02_Y% ; (WS_02) Window Select Same staff Sleep, 50 Click, %WS_04_X%, %WS_04_Y% ; (WS_04) Window Select Same voice Sleep, 50 Click, %WS_03_X%, %WS_03_Y% ; (WS_03) Window Select In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > Same subtype: Control + MidButton ~^MButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} ; executing each line needs 30 ms Sleep, 50 Send {down} Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 150 ; important! Send {right} Sleep, 200 ; increase sleeptime if needed Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_01_X%, %WS_01_Y% ; (WS_01) Window Select Same subtype Sleep, 50 Click, %WS_03_X%, %WS_03_Y% ; (WS_03) Window Select In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Score > Same subtype: Shift + MidButton ~+MButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} ; executing each line needs 30 ms Sleep, 50 Send {down} Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 50 Send {down } Sleep, 150 ; important! Send {right} Sleep, 200 ; increase sleeptime if needed Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_01_X%, %WS_01_Y% ; (WS_01) Window Select Same subtype Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > Same subtype > Same voice: Alt + MidButton ~!MButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 600 ; additional sleeptime increases stability Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_01_X%, %WS_01_Y% ; (WS_01) Window Select Same subtype Sleep, 50 Click, %WS_04_X%, %WS_04_Y% ; (WS_04) Window Select Same voice Sleep, 50 Click, %WS_03_X%, %WS_03_Y% ; (WS_03) Window Select In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > same subtype. CapsLock + MidButton ~CapsLock & MButton:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {up} Send {Enter} ; opens Window Select Sleep, 200 CoordMode, Mouse, Window Click, %WS_02_X%, %WS_02_Y% ; (WS_02) Window Select Same staff Sleep, 50 Click, %WS_01_X%, %WS_01_Y% ; (WS_01) Window Select Same subtype Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > same subtype > same voice. WinLogo key + MidButton #MButton:: Keywait, LWin, u Keywait, MButton, u Click, right CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 150 ; important! Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WS_01_X%, %WS_01_Y% ; (WS_01) Window Select Same subtype Sleep, 50 Click, %WS_02_X%, %WS_02_Y% ; (WS_02) Window Select Same staff Sleep, 50 Click, %WS_04_X%, %WS_04_Y% ; (WS_04) Window Select Same voice Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; ================= SELECT NOTES ======== in contextual menu 8 x down ================= ; Range > all notes with the same DURATION. Closing bracket + D ~] & d:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} ; executing each line adds 30 ms of sleep Sleep, 50 Send {down} ; this delay is needed when many notes are selected Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Notes Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WSN_05X%, %WSN_05Y% ; (WSN_05) Window Select Notes Same duration Sleep, 50 Click, %WSN_08X%, %WSN_08Y% ; (WSN_08) Window Select Notes In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > all notes with the same PITCH. Closing bracket + P ~] & p:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Notes Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WSN_02X%, %WSN_02Y% ; (WSN_02) Window Select Notes Same pitch Sleep, 50 Click, %WSN_08X%, %WSN_08Y% ; (WSN_08) Window Select Notes In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > all notes with the same NOTENAME. Closing bracket + N ~] & n:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} ; executing each line takes about 30 ms Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Notes Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WSN_06X%, %WSN_06Y% ; (WSN_06) Window Select Notes Same note name Sleep, 50 Click, %WSN_08X%, %WSN_08Y% ; (WSN_08) Window Select Notes In selection Sleep, 50 Send {Enter} CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > all notes with the same VOICE. Closing bracket + V ~] & v:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Sleep, 50 Send {Enter} ; opens Window Select Notes Sleep, 200 ; increase sleeptime if needed CoordMode, Mouse, Window Click, %WSN_09X%, %WSN_09Y% ; (WSN_09) Window Select Notes Same voice Sleep, 50 Click, %WSN_08X%, %WSN_08Y% ; (WSN_08) Window Select Notes In selection Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > notes > same DURATION. Opening bracket + D ~[ & d:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Send {Enter} ; opens Window Select Notes Sleep, 200 CoordMode, Mouse, Window Click, %WSN_05X%, %WSN_05Y% ; (WSN_05) Window Select Notes Same duration Sleep, 50 Click, %WSN_07X%, %WSN_07Y% ; (WSN_07) Window Select Notes Same staff Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > notes > same PITCH. Opening bracket + P ~[ & p:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Send {Enter} ; opens Window Select Notes Sleep, 200 CoordMode, Mouse, Window Click, %WSN_02X%, %WSN_02Y% ; (WSN_02) Window Select Notes Same pitch Sleep, 50 Click, %WSN_07X%, %WSN_07Y% ; (WSN_07) Window Select Notes Same staff Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > notes > SAME NOTENAME. Opening bracket + N ~[ & n:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Send {Enter} ; opens Window Select Notes Sleep, 200 CoordMode, Mouse, Window Click, %WSN_06X%, %WSN_06Y% ; (WSN_06) Window Select Notes Same note name Sleep, 50 Click, %WSN_07X%, %WSN_07Y% ; (WSN_07) Window Select Notes Same staff Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Staff > notes > same VOICE. Opening bracket + V ~[ & v:: Click, right MouseGetPos, StartX, StartY ; original mouse position is stored Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {up} Send {Enter} ; opens Window Select Notes Sleep, 200 CoordMode, Mouse, Window Click, %WSN_09X%, %WSN_09Y% ; (WSN_09) Window Select Notes Same voice Sleep, 50 Click, %WSN_07X%, %WSN_07Y% ; (WSN_07) Window Select Notes Same staff Sleep, 50 Send {Enter} ; OK CoordMode, Mouse, Screen MouseMove, StartX, StartY ; back to original position Return ; Range > only the noteheads or ONLY the rests. Closing bracket + H ; useful for coloring ~] & h:: CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; original mouse position is stored Click, right Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {right} Sleep, 50 Send {down} Sleep, 50 Send {down} Sleep, 50 Send {Enter} MouseMove, StartX, StartY ; back to original position Return