Automate hitting the "Apply" button: [AppleScript] + [Cliclick] + [Bome Midi Translator Pro]

With the help of Bome Midi Translator Pro (and the code I’ve posted below), the user can press the “C” key 3 times and the script will automatically:
1) Find the xy coordinates of the Apply button (in “Set Note Info”)
2) Close the window.

If you need to use the script, you also need to install cliclick.

-- Applescript 2.7 code
	tell application "System Events"
		tell application process "Cubase 11"
			perform action "AXRaise" of (first window whose name contains "Set Note Info")
		end tell
	end tell
	tell application "System Events"
		set button_t_p to (position of button 3 of window "Set Note Info" of application process "Cubase 11" of application "System Events")
		set x to (item 1 of button_t_p) + 230 as integer
		set y to (item 2 of button_t_p) + 365 as integer
		do shell script "eval $(/usr/libexec/path_helper -s); cliclick -r c:" & x & "," & y
		keystroke "w" using command down
	end tell
on error
end try