• SONAR
  • [Solved] SPlat and Autohotkey Just a simple Mouse click
2016/12/16 04:58:51
Bassman002
Hi:)
 
Does anybody know the program autohotkey? 
 
Especially how to do a simple click in Sonar and make a keystroke for it?
 
I've downloaded autohotkey, but it seems to be difficult to work with:( I've bought Hotkeycontrol, but the mouse macros doesn't work within Sonar, and the support of inchwest company doesn't answer on my emails!
 
Would be very helpful to just explain shortly how to capture a mouse movement and to click on just an ">".
I've read that there is a function called:
 
Click 100, 200, 1
 
for to move the mouse and click on a special point in the active window, but I can't figure out how to make a Keystroke out of it.....
 
Thank you a lot for help;)
Bassman.
 
2016/12/16 10:11:42
scook
Look at the top of the ahk help in the Hotkeys sections under "Basic: Usage and Syntax"
Here is an example binding the > key to a single click of the left mouse button at 100,200:
>::
Click 100, 200

Return
Or since there is only one command:
>::Click 100, 200
 
To run while SONAR has focus (assuming SONAR Platinum) add a guard like this
#If WinActive("ahk_exe i)SONARPLT.exe")
>::
Click 100, 200

Return
#If
 
To make this always available add the subroutine to the AutoHotkey.ahk script in your documents directory and add authotkey.exe to windows start up.
 
In addition to the help, Google is your friend. Internet searches usually point me to worked examples of what I want in the ahk forum.
2016/12/16 10:40:55
craigr68
Yes, I've been working with autohotkey a lot for about 4 years and use it extensively.  When I first discovered Autohotkey, I was just looking for some simple hotkey functionality.  I found it to be much more - almost a complete programming language, but simple enough to do a lot of very useful things.  It can get complex too depending on how far you take it.  Before I get to your question, the included Autohotkey help is really good - try looking at help for "click".  Also, I constantly google things like "autohotkey" followed by whatever I'm trying to figure out, and very often find excellent solutions.  There's tons of help out there. 
 
Anyway here's a simple example for j key to move mouse to the x & y coordinates 708,475 and left click that coordinate.  CoordMode most common options are Window & Screen.  That determines if the x & y coordinates are relative to the particular window you have open (and has focus) or relative to the overall full screen.  If you paste this to a text file, save it with an extension of .ahk, double click it, it should run if you have autohotkey installed.  Maybe call it test.ahk.  When you run it, it should show up in your tray (assuming you let Windows show it in the tray).  If you then right click on the tray icon, you can choose exit to close the script or choose Help to open their extensive help.  You can compile it to .exe file if you want and then it'll run even on a computer that doesn't have autohotkey installed.
 
#SingleInstance force
SetTitleMatchMode, 2
CoordMode, Mouse, Window

j::
Click,708,475
return


 
2016/12/16 10:47:02
Bassman002
@scook
 
I'll give that a try over the weekend, but...
 
How can I find out at what position (100,200) I have to click, does it depend on the resolution?? 
In Track View I have the Inspector on the left side, and the EQ as the first PlugIn, the Compressor second.I want to just click on the "ZoomOut" or FlyOut knob.
 
Thanks:)
Bassman.
 
2016/12/16 10:50:50
Bassman002
HI again:)
 
Found something:
 
http://www.adminsehow.com/2012/03/realtime-mouse-position-monitor-tool/

 
That would help.....
 
 145,165 at a resolution 1920 x 1080 for my ProChannel default...
 
Bassman.
 
2016/12/16 10:51:19
craigr68
To determine the coordinates you want to click on in Splat, right click the test.ahk tray icon, click Window Spy and it'll open, move Window Spy out of your way some, move your cursor over Splat and Window Spy will be showing you the mouse coordinates.  You'll see two sets of coordinates - On Screen and In Active Window which is what I was referring to with Coordmode.  I'd recommend In Active Window coordinates since I had set "CoordMode, Mouse, Window". 
2016/12/16 11:01:06
Bassman002
@craigr68
 
Thank you very much:) I think I have to read the manual just a bit to understand how it works....
 
Bassman.
 
2016/12/19 08:02:52
Bassman002
HI:)
 
@scook @craigr68
 
I've tried 
=========================================
#If WinActive("ahk_exe i)SONARPLT.exe")
a::
Click 40, 33

Return
#If
============================================
and this
 
==============================
#SingleInstance force
SetTitleMatchMode, 2
CoordMode, Mouse, Window

a::
Click 40, 33, 1
return

=================================
just to test to open the file menu, but nothing happens!
 
I've made a text file on the desktop:
FlyOut.ahk
 
started it and a green "H" appears in the tray
started SPlat
typed "a" and nothing
 
What am I doing wrong?
It's the same kind as with Hotkeycontrol, as soon as I start SPlat it doesn't work.
 
Bassman.
 
 I 've tried with an Notepad Window, there it works, but not with SPlat
 
 
2016/12/19 12:03:04
craigr68
Why don't you try this as a script.  It worked testing on my computer and opened the File menu.  Notice I have a few commented out lines with a semicolon in front which will be ignored when running.  I left them in so you could use them to troubleshoot if this doesn't work.  If you don't need them, I'd delete them in your final version.  If it still doesn't work remove the semi colons on the MouseGetPos & Msgbox lines and it should display your mouse coordinates before and after.  Let me know if you have more problems.  
 
#SingleInstance force
SetTitleMatchMode, 2
CoordMode, Mouse, Window
;To comment out any lines use a semicolon in front like this line
;#If WinActive("ahk_exe i)SONARPLT.exe")                   ;scook's version doesn't work for me
;#IfWinActive ahk_class SONAR Platinum Platinum
#IfWinActive SONAR Platinum
a::
;MouseGetPos, OutputVarX, OutputVarY
;Msgbox, Before`nOutputVarX: %OutputVarX%`nOutputVarY: %OutputVarY%
Click,40,33
;MouseGetPos, OutputVarX, OutputVarY
;Msgbox, After`nOutputVarX: %OutputVarX%`nOutputVarY: %OutputVarY%
return


2016/12/19 12:11:49
scook
craigr68
;#If WinActive("ahk_exe i)SONARPLT.exe")                   ;scook's version doesn't work for me

I get the feeling you are not using AutoHotKey v1.1.24.03 from https://autohotkey.com/
 
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account