Adding Mouse macro after a combination of keys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
DMDComposer
Posts: 12
Joined: 14 Jul 2018, 18:55
Contact:

Adding Mouse macro after a combination of keys

09 Jun 2019, 10:11

Hi,

I'm working on this script and I'm still new to the coding. My code works great so far except now I'm trying to get a little more advanced with adding mouse movement and I'm having trouble getting the code to work since I'm not sure how to edit into my script. Here is the basic of how my script works.
1) I hit F15 to activate the code
2) Enter a 3 digit code to execute a certain order of events/combinations

I have a command now that I want to execute steps 1 & 2 per usual, but after 2 I want to execute a mouse macro that I used making "feiyue Mouse & Keyboard Macro". But after pasting it after my code I'm getting errors. Suggestions?

Specific code I'm having trouble with

Code: Select all

else if command = 104 ;Advanced Filter - Hairpins
		Send,
			!{0}^a{BACKSPACE}Advanced Filter{Sleep 10}{Enter}
			{	CoordMode, Mouse, Window

					Sleep, 500

					WinWait, Advanced Filter ahk_class Qt5QWindow,, 5
					WinActivate, Advanced Filter ahk_class Qt5QWindow

					Sleep, 500

					MouseClick, L, 80, 748

					Sleep, 500

					MouseClick, L, 75, 282

					Sleep, 500

					MouseClick, L, 73, 375

					Sleep, 500

					MouseClick, L, 348, 142

					Send, {Blind}{Ctrl Down}

					Sleep, 500

					MouseClick, L, 353, 179

					Sleep, 500

					Send, {Blind}{Ctrl Up}

					Sleep, 500

					MouseClick, L, 1140, 750

					Sleep, 500

					WinWait, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon,, 5
					WinActivate, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon
			}
Here is my full code so far:

Code: Select all

F15::
input, command, L3 ; L3 to limit the input to 3 keys.

; Focus Instrument Groups

	if command = 001
		Send,
			!{0}^a{BACKSPACE}Focus Wind{Sleep 10}{Enter}{Sleep 10}^!{0}
		
	else if command = 002
		Send,
			!{0}^a{BACKSPACE}Focus Brass{Sleep 10}{Enter}
		
	else if command = 003
		Send,
			!{0}^a{BACKSPACE}Focus Unpitched{Sleep 10}{Enter}
	
	else if command = 004
		Send,
			!{0}^a{BACKSPACE}Focus Pitched Percussion No Harp{Sleep 10}{Enter}
		
	else if command = 005
		Send,
			!{0}^a{BACKSPACE}Focus Singers{Sleep 10}{Enter}
			
	else if command = 006
		Send,
			!{0}^a{BACKSPACE}Focus Strings Plus Harp{Sleep 10}{Enter}
			
	else if command = 007 ;a2 players
		Send,
			^t{BACKSPACE}{Sleep 10}a2{Escape}{Sleep 10}
			^t{BACKSPACE}{Sleep 10}~C104, 2{Escape}
			
;Menu Commands

	else if command = 020
		Send,
			^{F1}{Sleep 10}
			
;ZOOM COMMANDS
			
	else if command = 070 ;Zoom 75%
		Send,
			!{0}^a{BACKSPACE}Zoom 75{Sleep 10}{Enter}
			
	else if command = 071
		Send,
			!{0}^a{BACKSPACE}Zoom Fit Page Height{Sleep 10}{Enter}
			
			
;FILTER COMMANDS

	else if command = 099 ;Advanced Filter
		Send,
			!{0}^a{BACKSPACE}Advanced Filter{Sleep 10}{Enter}

	else if command = 100 ;Filter Chord Symbols
		Send,
			!{0}^a{BACKSPACE}Filters Chord Symbo{Sleep 10}{Enter}
			
	else if command = 101 ;Filter Dynamics
		Send,
			+<!D{Sleep 10}
			
	else if command = 102 ;Filter Expression Text
		Send,
			!{0}^a{BACKSPACE}Filters Expression Text{Sleep 10}{Enter}
			
	else if command = 103 ;Filter Techinque Text
		Send,
			!{0}^a{BACKSPACE}Filters Technique Text{Sleep 10}{Enter}
			
	else if command = 104 ;Advanced Filter - Hairpins
		Send,
			!{0}^a{BACKSPACE}Advanced Filter{Sleep 10}{Enter}
			{	CoordMode, Mouse, Window

					Sleep, 500

					WinWait, Advanced Filter ahk_class Qt5QWindow,, 5
					WinActivate, Advanced Filter ahk_class Qt5QWindow

					Sleep, 500

					MouseClick, L, 80, 748

					Sleep, 500

					MouseClick, L, 75, 282

					Sleep, 500

					MouseClick, L, 73, 375

					Sleep, 500

					MouseClick, L, 348, 142

					Send, {Blind}{Ctrl Down}

					Sleep, 500

					MouseClick, L, 353, 179

					Sleep, 500

					Send, {Blind}{Ctrl Up}

					Sleep, 500

					MouseClick, L, 1140, 750

					Sleep, 500

					WinWait, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon,, 5
					WinActivate, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon
			}
		
	else if command = ;Key Command Here
		; do something else

; and so on
return
Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Adding Mouse macro after a combination of keys  Topic is solved

09 Jun 2019, 10:47

Hallo,
try:

Code: Select all

else if command = 104 ;Advanced Filter - Hairpins
{
	Send,
		!{0}^a{BACKSPACE}Advanced Filter{Sleep 10}{Enter}
	CoordMode, Mouse, Window
	Sleep, 500
	WinWait, Advanced Filter ahk_class Qt5QWindow,, 5
	WinActivate, Advanced Filter ahk_class Qt5QWindow
	Sleep, 500
	MouseClick, L, 80, 748
	Sleep, 500
	MouseClick, L, 75, 282
	Sleep, 500
	MouseClick, L, 73, 375
	Sleep, 500
	MouseClick, L, 348, 142
	Send, {Blind}{Ctrl Down}
	Sleep, 500
	MouseClick, L, 353, 179
	Sleep, 500
	Send, {Blind}{Ctrl Up}
	Sleep, 500
	MouseClick, L, 1140, 750
	Sleep, 500
	WinWait, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon,, 5
	WinActivate, Vocalise No. 1 - Sibelius ahk_class Qt5QWindowIcon
}
DMDComposer
Posts: 12
Joined: 14 Jul 2018, 18:55
Contact:

Re: Adding Mouse macro after a combination of keys

09 Jun 2019, 10:55

Perfect! I knew it had to be as silly as a wrong bracket placement. Thanks a bunch! <3
Sweet Alert 2 for AHK - A Beautiful JS Popup MSG & Toast Notifications
https://github.com/DMDComposer/SweetAlert2-AHK
Master Search Box aka Master Script Commands v1 - AHK Gui for user commands
https://github.com/DMDComposer/MasterSearchBox
Master Script Commands v2 - AHK Gui using G33kdude's neutron for user commands
https://github.com/DMDComposer/MasterScriptCommands

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], NullRefEx and 117 guests