[Solved] SPlat and Autohotkey Just a simple Mouse click

Author
Bassman002
Max Output Level: -84 dBFS
  • Total Posts : 321
  • Joined: 2014/12/19 05:51:16
  • Status: offline
2016/12/16 04:58:51 (permalink)

[Solved] SPlat and Autohotkey Just a simple Mouse click

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.
 
post edited by Basseman - 2016/12/21 05:26:16
#1

16 Replies Related Threads

    scook
    Forum Host
    • Total Posts : 24146
    • Joined: 2005/07/27 13:43:57
    • Location: TX
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 10:11:42 (permalink)
    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.
    #2
    craigr68
    Max Output Level: -88 dBFS
    • Total Posts : 102
    • Joined: 2015/08/26 14:06:58
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 10:40:55 (permalink)
    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


     
    #3
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 10:47:02 (permalink)
    @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.
     
    #4
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 10:50:50 (permalink)
    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.
     
    #5
    craigr68
    Max Output Level: -88 dBFS
    • Total Posts : 102
    • Joined: 2015/08/26 14:06:58
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 10:51:19 (permalink)
    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". 
    #6
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/16 11:01:06 (permalink)
    @craigr68
     
    Thank you very much:) I think I have to read the manual just a bit to understand how it works....
     
    Bassman.
     
    #7
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 08:02:52 (permalink)
    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
     
     
    post edited by Basseman - 2016/12/19 10:28:55
    #8
    craigr68
    Max Output Level: -88 dBFS
    • Total Posts : 102
    • Joined: 2015/08/26 14:06:58
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 12:03:04 (permalink)
    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


    #9
    scook
    Forum Host
    • Total Posts : 24146
    • Joined: 2005/07/27 13:43:57
    • Location: TX
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 12:11:49 (permalink)
    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/
     
    #10
    craigr68
    Max Output Level: -88 dBFS
    • Total Posts : 102
    • Joined: 2015/08/26 14:06:58
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 12:16:26 (permalink)
    Ya, I'm on 1.1.16.05.  I'll check out the latest.  Thanks for the heads up.
    #11
    craigr68
    Max Output Level: -88 dBFS
    • Total Posts : 102
    • Joined: 2015/08/26 14:06:58
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 14:19:42 (permalink)
    Got 1.1.24.04 installed but no change noticed with that line.  Haven't had time to look into it much.  By the way Basseman, in case it isn't obvious, every time you edit the script you should reload it for change to take effect - right click tray icon -> Reload this script
    #12
    scook
    Forum Host
    • Total Posts : 24146
    • Joined: 2005/07/27 13:43:57
    • Location: TX
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/19 14:29:03 (permalink)
    I use
    SetTitleMatchMode, RegEx
    probably necessary for the i) switch
     
    I left it out of the examples above. It is at the top of the my default script. As you point out there are a variety of ways to guard the keybindings.
    #13
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/20 00:50:14 (permalink)
    HI:)
     
    I got it!!! It doesn't work, if I start SPlat as Administrator, what I normally do! 
    It does work on normal start.
     
    If you find a solution for the Administrator Mode, please let me know!I must see, if there are some behaviours in Normal Mode...
    Just one question again.
     
    How can I use Ctrl+Alt+J instead of "a"??        ^!j:: Is this correct?
     
    Thank you a lot for helping;)
    Bassman.
    #14
    scook
    Forum Host
    • Total Posts : 24146
    • Joined: 2005/07/27 13:43:57
    • Location: TX
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/20 02:35:41 (permalink)
    One way to make sure a script is running as administrator add the following near the top of the script
      If not A_IsAdmin
        Run *RunAs %A_ScriptFullPath%
     
    As mentioned above adding MsgBox lines in your scripts help testing things like
     
    Basseman
    How can I use Ctrl+Alt+J instead of "a"??        ^!j:: Is this correct?

     
    To test if ^!j:: is what you want create a test script
     
    ^!j::
    MsgBox, hello
    Return
     
    Load the script, try the keystrokes, if you see the message box , the binding works.
     
     
    #15
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/20 03:44:28 (permalink)
    @scook
     
    Fine, thank you:) 
    Both, SPlat and Autohotkey in Administrator Mode!
     
    Finally after a very long time I have a shortcut for the FlyOut Window Great!
     
    Bassman.
     
    #16
    Bassman002
    Max Output Level: -84 dBFS
    • Total Posts : 321
    • Joined: 2014/12/19 05:51:16
    • Status: offline
    Re: SPlat and Autohotkey Just a simple Mouse click 2016/12/29 02:05:41 (permalink)
    @scook @craigr68
     
    Some other problems with AHK. 
     
    ^!3:: (for example)
    Send {Alt}
    Return
     
    does NOT send ALt!
     
    3:: 
    Send {Alt}
    Return
     
    does send Alt!
     
    As soon as I use ^or ! or any other "shifted" Key, it doesn't work with sending {Alt}, why??
     
    Thank you a lot:)
     
    Bassman.
     
    #17
    Jump to:
    © 2025 APG vNext Commercial Version 5.1