#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 ; Only one instance of script can run. Restart replaces script (Reloads). #Persistent ; To make it run indefinitely #Include Coordinates.ahk ; All MuseScore 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 ; The file Coordinates.ahk is included to make operations in MuseScore still possible ToggleWinSpy := 0 ToggleAHKHelp := 0 CoordMode, Tooltip, Screen Tooltip, \ Independent Hotkeys, ToolT_IHK_X, 0, 1 ; tooltip (1) Independent Hotkeys ; ================================================================================================= ~[ & '::Reload ; Reload Independent Hotkeys ~] & \:: MsgBox, 4388, Independent Hotkeys, Are you sure you want to exit? IfMsgBox, No Return IfMsgBox, Yes { ToolTip, , , , 1 ; close tooltip (1) ToolTip, , , , 2 ; close tooltip (2) ExitApp } Return ~\ & m:: ; run Master MuseScore MsgBox, 4161, Run MuseScore Master AHK file, Run the MuseScore Master? IfMsgBox, Cancel Return Run, Master.ahk, , UseErrorLevel if (ErrorLevel = "Error") MsgBox, 4112, Run MuseScore Master, ( The MuseScore Master could not be launched. Check name and location of the file. ) Return ; ♣==================================== HELP FILE ================================================= ~\ & h:: ; Help Independent Hotkeys MsgBox, 4096, Independent Hotkeys \ + H, ( Launch MuseScore M + S MS visible Focus on MuseScore M + S MS (in)visible Focus on MuseScore * Ctrl + WIN + Z * Restores Defined State Run Master MuseScore \ + M Run/Exit Window Spy \ + X Run/Exit AHK Help \ + Z Focus on systemtray # \ + S Focus on desktop Win + \ Click screencentre Z + 3 Centre Active Window size 1 Left Ctrl + \ Centre Active Window size 2 Right Ctrl + \ Window 1 left - Window 2 right Ctrl + Win + \ # E.g to inspect AHK scripts TEXT CONVERSION: Select text, copy to clipboard Ctrl + C Convert to uppercase Ctrl + Alt + U Convert to lowercase Ctrl + Alt + L Convert to capitalized Ctrl + Alt + C Convert to inverted Ctrl + Alt + I TEXT EDITING in Open Office Select font CapsLock + F1 Select font size CapsLock + F2 Rightclick desktop items / + . Rightclick highlighted file in Explorer / + . Copy XButton1 Paste XButton2 Open Inputbox Independent Hotkeys Z + W In InputBox enter Launch Google Chrome Incognito GCI Get Colour Mouseposition GCM Launch MuseScore MS Select File SF Reload IHK when Master is active [ + \ Reload IHK when Master is not active [ + ' Exit Independent Hotkeys ] + \ ) Return ; ♣================================= X-BUTTONS for COPY/PASTE ===================================== ~XButton1::Send ^c ; copy ~XButton2::Send ^v ; paste ; ♣=================================== RIGHTCLICK extended ======================================== ~/ & .:: ; right click SetTitleMatchMode, 2 DetectHiddenWindows, On DetectHiddenText, On If WinActive("ahk_exe Explorer.exe") && WinActive("ahk_class" . "CabinetWClass") { Send +{f10} Return } If WinExist("ahk_exe pixelmousing.ahk") Return If !WinExist("ahk_exe pixelmousing.ahk") Send {Click, right} Return ; The same functions in this Demo project. See pdf page 126 ; Click on centre desktop with Z + 3 to activate the Program Manager ; select desktop item with letter or number ; rightclick, rightclick desktop items when mouse is over them ; In Explorer: the hotkey rightclicks highlighted items ; This is an alternative for the Windows shortcut Shift + F10 /* ~/ & .:: ; right click SetTitleMatchMode, 1 CoordMode, Mouse, Screen If WinActive("ahk_exe Explorer.exe") && WinActive("ahk_class" . "CabinetWClass") Goto, SkipIconSel If WinActive("ahk_exe MuseScore3.exe") ; / + . same command in PixelMousing - rightclick { ; NB PixM is only active when MSc is active Sleep, 500 ; so that the rightclick happens in PixM Return } MouseMove, A_ScreenWidth / 2, A_ScreenHeight / 2 Click Tooltip, Type the FIRST letter or number`nof a desktop item and walk`nthrough them.`nPress Z when ready., , , 3 Keywait, z, d Tooltip, , , , 3 ; close tooltip (3) { PixelSearch, FindX, FindY, 0, 0, A_ScreenWidth, A_ScreenHeight, RGB_DesktopIcon, , fast RGB MouseMove, FindX, FindY ; on desktop RGB_DesktopIcon/ is color of highlighted icon Sleep, 100 Send {Click, right} FindX := "" FindY := "" Return } SkipIconSel: { ; search for color selected file CoordMode, Mouse, Screen WinGetPos, WinX, WinY, Width, Height, A ; get active window position CoordMode, Pixel, Screen ; WinY + 200: search beneath this point because otherwise (*change*?) Sleep, 50 ; the color of 'Select all' in ribbon will be found PixelSearch, FindX, FindY, WinX, WinY + 200, WinX + Width, WinY + Height, RGB_Expl_File, , fast RGB MouseMove, FindX, FindY ; in Explorer RGB_Expl_File is color of selected file Sleep, 100 Send {Click, right} FindX := "" FindY := "" Return } Return */ ; ♣========================= SHOW CAPSLOCK STATE when PM is inactive ============================== ~CapsLock:: ; Shows CapsLock state when PixelMousing is inactive DetectHiddenWindows, On SetTitleMatchMode, 2 If WinExist("PixelMousing") { state := GetKeyState("CapsLock", "T") If (state = 1) ToolTip, , , , 2 ; close tooltip (2) if CapsLock was still on Return ; the tooltip disappears when CapsLock is } ; switched on for the second time If !WinExist("PixelMousing") { state := GetKeyState("CapsLock", "T") If (state = 1) ToolTip, CapsLock ON, A_ScreenWidth, A_ScreenHeight, 2 ; tooltip (2) else ToolTip, , , , 2 ; close tooltip (2) } Return ; ♣======================================= CLICK SCREENCENTRE ===================================== ; command also in master.ahk where it can be useful to get the focus on inactive MsgBoxes ; e.g. during the utilities test image recognition or check coordinates ~z & 3:: ; click screencentre MouseMove, A_ScreenWidth / 2, A_ScreenHeight / 2 Click Return ; ♣==================================== GO TO AKH ICON IN SYSTEMTRAY ============================== ; this hotkey presupposes Full Screen as the defined state ~\ & s:: ; activate akh icon in systemtray If WinActive("ahk_exe MuseScore3.exe") ; if MuseScore is active ; WinMinimize, A ; minimize active window { ImageSearch, , , IM_01_X1, IM_01_Y1, IM_01_X2, IM_01_Y2, *40 IM_01_Inspector_Inspector.png If (ErrorLevel = 1) ; screen not in defined state Send #{down} ; minimize MuseScore If (ErrorLevel = 0) ; screen in defined state { Send ^u ; full screen off Sleep, 100 Send #{down} ; minimize MuseScore } } Sleep, 100 WinMinimizeAll Sleep, 50 Send #b ; win shortcut to systemtray Sleep, 100 Send {Enter} ; open the systemtray Send {up 8} Return ; ♣====================================== FOCUS ON DESKTOP ======================================== #\:: ; focus on desktop - windows stay open IfWinNotActive, Program Manager WinActivate, Program Manager Return ; ♣======================================== WINDOW SPY ============================================ #MaxThreadsPerHotkey, 2 ~\ & x:: ; run/exit Window Spy toggle ToggleWinSpy := !ToggleWinSpy If (ToggleWinSpy = 1) { Run, C:\Program Files\AutoHotkey\WindowSpy.ahk, , UseErrorLevel if (ErrorLevel = "Error") { MsgBox, 4112, Run Window Spy, ( Window Spy could not be launched. Check name and location of the file. ) Return } } else { if WinExist("Window Spy") WinActivate, Window Spy WinWaitActive, Window Spy WinClose, Window Spy ToggleWinSpy := 0 } Return #MaxThreadsPerHotkey, 1 ; ♣======================================= AHK HELP FILE ========================================== #MaxThreadsPerHotkey, 2 ~\ & z:: ; Run/exit AHK Help file toggle ToggleAHKHelp := !ToggleAHKHelp If (ToggleAHKHelp = 1) { Run, C:\Program Files\AutoHotkey\AutoHotkey.chm, , UseErrorLevel if (ErrorLevel = "Error") { MsgBox, 4112, Run AHK Help File, ( The AHK Help File could not be launched. Check name and location of the file. ) Return } } else { if WinExist("AutoHotkey Help") WinActivate, AutoHotkey Help WinWaitActive, AutoHotkey Help WinClose, AutoHotkey Help ToggleAHKHelp = 0 } Return #MaxThreadsPerHotkey, 1 ; ♣=================================== UNICODE INPUT ============================================== ~F3 & F2::Run, C:\Users\NewAdminPrimary\Downloads\Unicode\unicodeinput.exe ; ♣============================= FIXED SIZE and POSITION of Active Window(s) ===================== ~<^\:: ; centre active window, size it to 800x800 px (*change*?) id := WinExist("A") ; retrieve id of active window WinGetPos, , , Width, Height, A ; ~<^\:: is hotkey Left Ctrl + \ WinMove, A, , (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2), 800, 800 ; 800, 800 size of text window (*change*?) Return ~>^\:: ; centre active window, size it to 900x1200 px (*change*?) id := WinExist("A") ; retrieve id of active window WinGetPos, , , Width, Height, A ; ~>^\:: is hotkey Right Ctrl + \ WinMove, A, , (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2), 1050, 800 ; 1050, 800 size of text window (*change*?) Return ^#\:: ; position window 1 left and window 2 right Keywait, \, d Sleep, 100 If WinActive("ahk_exe MuseScore3.exe") ; if MuseScore is active Return ; do nothing id := WinExist("A") ; retrieve id of active window WinWait, A WinGetPos, , , Width, Height, A Sleep, 50 WinMove, A, , (A_ScreenWidth/9)-(Width/9), (A_ScreenHeight/2)-(Height/2), 800, 800 ; 800, 800 size of text window (*change*?) Sleep, 100 Send !{Tab} ; make next window in the stack active Sleep, 200 id := WinExist("A") ; retrieve id of active window WinWait, A WinGetPos, , , Width, Height, A Sleep, 50 WinMove, A, , (A_ScreenWidth/2)+10, (A_ScreenHeight/2)-(Height/2), 800, 800 ; 800, 800 size of text window (*change*?) Sleep, 100 ; 10 px more to the right so / + . will hit the screenz Return ; ♣===================================== TEXT UTILITIES =========================================== ; credits: ; https://autohotkey.com/board/topic/24431-convert-text-uppercase-lowercase-capitalized-or-inverted/page-3 ; select text, press Control + C, execute hotkey ^!u:: ; Convert text to upper TextConversion := "u" Goto, Conversion ^!l:: ; Convert text to lower TextConversion := "l" Goto, Conversion ^!c:: ; Convert text to capitalized TextConversion := "c" Goto, Conversion ^!i:: ; Convert text to inverted TextConversion := "i" Goto, Conversion Conversion: DetectHiddenWindows, On SetTitleMatchMode, 2 If !WinActive("ahk_exe MuseScore3.exe") { If (TextConversion = "u") { StringUpper, Clipboard, Clipboard Send %Clipboard% Return } If (TextConversion = "l") { StringLower, Clipboard, Clipboard Send %Clipboard% Return } If (TextConversion = "c") { StringUpper, Clipboard, Clipboard, T Send %Clipboard% Return } If (TextConversion = "i") { Lab_Invert_Char_Out:= "" Loop % Strlen(Clipboard) { Lab_Invert_Char:= Substr(Clipboard, A_Index, 1) if Lab_Invert_Char is upper Lab_Invert_Char_Out:= Lab_Invert_Char_Out Chr(Asc(Lab_Invert_Char) + 32) else if Lab_Invert_Char is lower Lab_Invert_Char_Out:= Lab_Invert_Char_Out Chr(Asc(Lab_Invert_Char) - 32) else Lab_Invert_Char_Out:= Lab_Invert_Char_Out Lab_Invert_Char } Send %Lab_Invert_Char_Out% } } Return ~CapsLock & f1:: ; select font only active in .odt documents CoordMode, Mouse, Window CoordMode, ToolTip, Window MouseGetPos, StartX, StartY SetTitleMatchMode, 2 If WinActive("OpenOffice") or WinActive("ahk_class" . SALFRAME) { Click, 366, 100 ; you have to determine yourself (*change*?) ToolTip, Press CapsLock`nwhen ready, 400, 100, 4 ; (*change*?) Sleep, 500 KeyWait, CapsLock, d ToolTip, , , , 4 ; close tooltip (4) Click, %StartX%, %StartY% } Return ~CapsLock & f2:: ; select font size only active in .odt documents CoordMode, Mouse, Window CoordMode, ToolTip, Window MouseGetPos, StartX, StartY SetTitleMatchMode, 2 If WinActive("OpenOffice") or WinActive("ahk_class" . SALFRAME) { Click, 441, 100 ; you have to determine yourself (*change*?) ToolTip, Press CapsLock`nwhen ready, 475, 100, 4 ; (*change*?) Sleep, 500 KeyWait, CapsLock, d ToolTip, , , , 4 ; close tooltip (4) Click, %StartX%, %StartY% } Return ; ♣================================ LAUNCH MUSESCORE / FOCUS ON MUSESCORE ========================= ~m & s:: ; launch OR focus on MuseScore If !WinExist("ahk_exe MuseScore3.exe") Run, S:\musescore_opengl_36 Portable.bat ; (*change*?) replace by your locaation of MuseScore Else SetTitleMatchMode, 2 SetWinDelay, 50 If WinExist("ahk_exe MuseScore3.exe") ; with MSc visible Focus on MuseScore WinActivate, ahk_exe MuseScore3.exe Sleep, 300 CoordMode, Mouse, Screen HalfScreenWidth := A_ScreenWidth / 2 ThirdScreenHeight := A_ScreenHeight / 3 Click, %HalfScreenWidth%, %ThirdScreenHeight% ; WinWait, ahk_exe MuseScore3.exe ; WinShow, ahk_exe MuseScore3.exe ; PostMessage, 0x112, 0xF120,,, ahk_exe MuseScore3.exe, MuseScore3 ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE ; WinRestore, ahk_exe MuseScore3.exe, MuseScore3 ; see AHK Help 'WinRestore' ; WinShow, MuseScore3 Return ; ♣============================================== INPUTBOX ======================================== ~z & w:: ; independent hotkeys inputbox CoordMode, Mouse, Screen MouseGetPos, StartX, StartY ; InputBox, Ind_HK, Independent Hotkeys, , , W_IB, H_IB, IB_X, IB_Y, , , Enter command Help = ? ; (*change?*) InputBox positioned in Inspector area InputBox, Ind_HK, Independent Hotkeys, , , W_IB, H_IB, StartX, StartY - 120, , , Enter command Help = ? ; (*change?*) InputBox positioned near the mouse If ErrorLevel ; when Cancel is pressed Return If (Ind_HK = "?") || (Ind_HK = "Enter command Help = ?") { MsgBox, 4097, Independent Hotkeys, ( Open Inputbox Independent Hotkeys Z + W In InputBox enter Get Colour Mouseposition GCM Launch Google Chrome Incognito GCI Launch Notepad NP Launch MuseScore MS Select File SF ) IfMsgBox, Cancel Return IfMsgBox, OK { ; InputBox, Ind_HK, Independent Hotkeys, , , W_IB, H_IB, IB_X, IB_Y, , , Enter command ; (*change?*) InputBox positioned in Inspector area InputBox, Ind_HK, Independent Hotkeys, , , W_IB, H_IB, StartX, StartY - 120, , , Enter command ; (*change?*) InputBox positioned near the mouse If ErrorLevel ; when Cancel is pressed Return } } If Ind_HK not in gcm,gci,ms,np,sf { MsgBox, 4144, Independent Hotkeys, Invalid command!`nThe macro will exit. Return } If (Ind_HK = "sf") { If !WinExist("ahk_exe MuseScore3.exe") ; if MuseScore is not running { MsgBox, 4112, Independent Hotkeys, This command functions only when MusesScore is running.`nThe macro wiill exit. Return } If WinExist("ahk_exe MuseScore3.exe") ImageSearch, , , IM_01_X1, IM_01_Y1, IM_01_X2, IM_01_Y2, *40 IM_01_Inspector_Inspector.png If (ErrorLevel = 1) ; screen not in defined state Send #{down} ; minimize MuseScore If (ErrorLevel = 0) ; screen in defined state { Send ^u ; full screen off Sleep, 100 Send #{down} ; minimize MuseScore } ; FileSelectFile, SelectedFile, 3, A_ScriptDir\MuseScore_logo_round.jpg FileSelectFile, SelectedFile, 3, %A_WorkingDir%\MuseScore_logo_round.jpg ; MsgBox, 4096, Independent Hotkeys, The selected file is:`n%SelectedFile% Run, %SelectedFile% Tooltip, When ready`nClose window and`nactivate MuseScore`nby pressing Z., , , 2 KeyWait, z, d Tooltip, , , , 2 ; end of tooltip (2) WinActivate, ahk_exe MuseScore3.exe If (Ind_HK = "sf") Goto, FinishFileSelection ; to next hotkey (try to restore defined state) } If (Ind_HK = "gcm") { CoordMode, Mouse, Screen CoordMode, Pixel, Screen MouseGetPos, X, Y PixelGetColor, PixColor, %X%, %Y% , RGB MsgBox, 4160, Color of mousepositionpixel , --- The color is %PixColor% --- Return } If (Ind_HK = "gci") Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -incognito If (Ind_HK = "ms") Run, S:\musescore_opengl_36 Portable.bat ; (*change*?) replace by your locaation of MuseScore If (Ind_HK = "np") Run, Notepad.exe Return ; ♣======================================= RESTORE MUSESCORE ====================================== ; replaces Alt + TAB, activates MuseScore, resets width of Inspector and Palettes ; restores MAX CANVAS (or alternatively Toolbars Note Input + Workspaces) ; expands collapsed inspector sections of selected element ▼ instead of ► (if any) ; and tests Defined State ^#z:: ; restore MuseScore SetTitleMatchMode, 2 SetWinDelay, 50 If WinExist("ahk_exe MuseScore3.exe") WinActivate, ahk_exe MuseScore3.exe WinWait, ahk_exe MuseScore3.exe PostMessage, 0x112, 0xF120,,, ahk_exe MuseScore3.exe, MuseScore3 ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE (WinRestore) SetWinDelay, 50 CoordMode, Mouse, Screen FinishFileSelection: ; label of previous hotkey fileselection Send ^u ; full screen (*change*?) ; Send #{up} ; maximized screen if this is defined state Sleep, 200 /* ; ALTERNATIVE VERSION: Defined State must contain Toolbars NOTE INPUT and WORKSPACES only ; as per alternative version for the hotkey CapsLock + 8 Loop { MouseMove, % ToolBarSel_X, % ToolBarSel_Y ; to Toolbar selection spot Click, right Sleep, 150 ; in the meantime open contextual menu. sleeptime dependent on system and CPU load (*change*?) ImageSearch, Tick_X, Tick_Y, FoFb_X1, FoFb_Y1, FoFb_X2, FoFb_Y2, *40 CTS_Checked_ticked_sign.png If (ErrorLevel = 0) ; if tick √ present { MouseMove, Tick_X + ToolBTickOffset_X, Tick_Y + ToolBTickOffset_Y Click ; click tick away Sleep, 50 ; click closes contextual menu Continue ; execute again from first line of loop } If (ErrorLevel = 1) ; when all ticks in search area are unticked Break ; stop search loop from 'File Operations' to 'Feedback' } ; contextual menu is still open ImageSearch, Tick_X, Tick_Y, NoteInp_X1, NoteInp_Y1, NoteInp_X2, NoteInp_Y2, *40 CTS_Checked_ticked_sign.png If (ErrorLevel = 1) ; if tick √ is not present { MouseMove, NoteInp_X1 + ToolBTickOffset_X, NoteInp_Y1 + ToolBTickOffset_Y Click ; switch toolbar Note Input on Sleep, 50 ; click closes contextual menu MouseMove, % ToolBarSel_X, % ToolBarSel_Y ; to Toolbar selection spot Click, right Sleep, 150 ; in the meantime open contextual menu again Goto, CheckWorkspaces } If (ErrorLevel = 0) Goto, CheckWorkspaces CheckWorkspaces: ImageSearch, Tick_X, Tick_Y, WorkSp_X1, WorkSp_Y1, WorkSp_X2, WorkSp_Y2, *40 CTS_Checked_ticked_sign.png If (ErrorLevel = 1) ; if tick √ is not present { MouseMove, WorkSp_X1 + ToolBTickOffset_X, WorkSp_Y1 + ToolBTickOffset_Y Click ; switch toolbar Workspaces on } If (ErrorLevel = 0) ; if tick √ is present Click, %ToolBarSel_X%, %ToolBarSel_Y% Sleep, 50 ; click closes contextual menu ; END OF ALTERNATIVE VERSION */ Loop ; all toolbars off (as per hotkey CapsLock + 8) { MouseMove, % ToolBarSel_X, % ToolBarSel_Y ; click Toolbar selection spot Click, right Sleep, 150 ; time to open contextual menu ImageSearch, Tick_X, Tick_Y, CTS_X1, CTS_Y1, CTS_X2, CTS_Y2, *40 CTS_Checked_ticked_sign.png If (ErrorLevel = 0) ; if tick √ present { MouseMove, Tick_X + ToolBTickOffset_X, Tick_Y + ToolBTickOffset_Y Click ; click tick away Sleep, 50 Continue } If (ErrorLevel = 1) ; when all ticks in search area are unticked { Click, %ToolBarSel_X%, %ToolBarSel_Y% Break ; stop search loop } } ImageSearch, , , IM_01_X1, IM_01_Y1, IM_01_X2, IM_01_Y2, *40 IM_01_Inspector_Inspector.png If (ErrorLevel = 0) ; if Inspector in defined state Goto, AdjustPalWidth If (ErrorLevel = 1) ; if not in def. state (Inspector not present or undocked) { ImageSearch, X, Y, IM_01_2_X1, IM_01_2_Y1, IM_01_2_X2, IM_01_2_Y2, *40 IM_01_2_Inspector_Displaced_Insp.png If (ErrorLevel = 1) ; Inspector not present or undocked { MsgBox, 4112, Restoring the Defined State, ( Restoring failed. In some situations repeating the command restores as yet. Possible failure causes : In the contextual menu the 'Play Panel' item is missing or a side panel is not present or undocked. NB: The Play Panel must be activated at least once before it appears in the list. ) Return } If (Errorlevel = 0) { MouseMove, (X-=Insp_Loc_Dist_X), A_ScreenHeight / 2 ; Click, down ; drag enable Sleep, 50 MouseMove, % Def_Insp_Width, % A_ScreenHeight / 2 ; to my defined Inspector width Sleep, 50 Click, U ; drag disable Send {Escape} Sleep, 50 } } AdjustPalWidth: ImageSearch, X, Y, Pal_Loc_X1, Pal_Loc_Y1, Pal_Loc_X2, Pal_Loc_Y2, *80 Palette_Locator_Left.png If (Errorlevel = 0) { MouseMove, (X+=Left_Loc_Dist_X), A_ScreenHeight / 2 ; measured distance to separator is 30 Sleep, 50 Click, Down ; drag enable Sleep, 50 MouseMove, % Def_Pal_Width, % A_ScreenHeight / 2 ; to my defined Palettes width Sleep, 50 Click, U ; drag disable Sleep, 50 Send {Escape} Sleep, 50 } If (Errorlevel = 1) { ImageSearch, X, Y, Pal_Loc_X1, Pal_Loc_Y1, Pal_Loc_X2, Pal_Loc_Y2, *80 Palette_Locator_Right.png If (Errorlevel = 0) { MouseMove, (X+=Right_Loc_Dist_X), A_ScreenHeight / 2 ; measured distance to separator is 42 Sleep, 50 Click, Down ; drag enable Sleep, 50 MouseMove, % Def_Pal_Width, % A_ScreenHeight / 2 ; to my defined Palettes width Sleep, 50 Click, U ; drag disable Sleep, 50 Send {Escape} Sleep, 50 } If (Errorlevel = 1) MsgBox, 4144, To Defined State Palettes, Palettes Separator not found.`nTry the utility Reset Width Palettes.`nPress Z + U and enter RWP.`nAlternatively: Press Z + 1 } Loop, 8 ; trying to select a note or rest { Send !{right} Sleep, 250 ; accounts also for one or more articulations ImageSearch, , , SB_X1, SB_Y1, SB_X2, SB_Y2, *40 Statusbar_Note_Pitch.png If (ErrorLevel = 1) { ImageSearch, , , SB_X1, SB_Y1, SB_X2, SB_Y2, *40 Statusbar_Rest.png If (ErrorLevel = 1) Continue If (ErrorLevel = 0) Break } If (ErrorLevel = 0) Break } PixelSearch, ElementX, ElementY, % CSA_X1, % CSA_Y1, % CSA_X2, % CSA_Y2, ColorV1, , Fast RGB ; voice 1 if ErrorLevel PixelSearch, ElementX, ElementY, % CSA_X1, % CSA_Y1, % CSA_X2, % CSA_Y2, ColorV2, , Fast RGB ; voice 2 if ErrorLevel PixelSearch, ElementX, ElementY, % CSA_X1, % CSA_Y1, % CSA_X2, % CSA_Y2, ColorV3, , Fast RGB ; voice 3 if ErrorLevel PixelSearch, ElementX, ElementY, % CSA_X1, % CSA_Y1, % CSA_X2, % CSA_Y2, ColorV4, , Fast RGB ; voice 4 if ErrorLevel Return Click, %ElementX%, %ElementY% Sleep, 50 Loop, 30 ; expands collapsed Inspector sessions { ImageSearch, TrX, TrY, IM_18_X1, IM_18_Y1, IM_18_X2, IM_18_Y2, IM_18_Inspector_Triangle_Closed.png If (ErrorLevel = 0) { MouseMove, TrX + TriAngleOffset_X, TrY + TriAngleOffset_Y Click Sleep, 50 Continue } If (ErrorLevel = 1) Break } Sleep, 300 ImageSearch, , , IM_01_X1, IM_01_Y1, IM_01_X2, IM_01_Y2, *40 IM_01_Inspector_Inspector.png If (ErrorLevel = 0) ; if Inspector in defined state MsgBox, 4160, Check Defined State, Defined State succesfully restored, 2 If (ErrorLevel = 1) ; if Inspector not in defined state MsgBox, 4112, Check Defined State, Failed to restore the Defined State, 2 Click, %ElementX%, %ElementY% Return ; ♣================================================================================================