No internet connection
  1. Home
  2. How to

How to find the x/y relativePosition for mouse clicks in Cubase

By Steve @stevef
    2018-07-26 20:33:06.702Z

    As the title says, how do I find the x/y position of the cursor? I thought using the screenshot option on the mac would work, but that doesn't't seem to return the actual portion that Soundflow/Cubase want.

    Solved in post #5, click to view
    • 9 replies
    1. S
      Steve @stevef
        2018-07-26 21:02:12.933Z

        Actually I figured it out - the screenshot cursor thing works, but it is relative to the window that is open.

        However, is there a way to select a position on the whole screen rather than being relative?

        1. ?@anon6770933309
            2018-07-26 21:33:39.173Z2018-07-26 22:27:51.836Z

            Obsolete.

            1. SSteve @stevef
                2018-07-26 22:54:32.743Z

                Thanks, I will take a look.

            2. In reply tostevef:

              @stevef, the preferred way of clicking with the mouse, is using SF to click relative to a window or UI element, so the relative position is what you want:

              var projectWin = sf.ui.cubase.getWindowWithTitleStartingWith("Cubase Pro Project");
              projectWin.mouseClickElement({
                  relativePosition: {
                      x: 124,
                      y: 95,
                  }
              });
              
              ReplySolution
              1. SSteve @stevef
                  2018-07-27 08:13:44.203Z

                  Thanks Christian

                  1. In reply tochrscheuer:
                    SSebastian @Sebastian
                      2020-08-14 12:18:34.011Z

                      Hi, how do you actually find the right x and y postion for a mouse Click?

                      1. Hi Sebastian,

                        Anything involving positions for mouse clicks is an inherently unstable way to approach things, as naturally if you hard-code the values they are likely to change if for example you resize your window and stuff like that.
                        If you do want to use x and y values, to get them, the easiest way to do it is to press Ctrl+Shift+Command+4 to create a screenshot on your Mac. Then with your mouse drag from the top-left corner of the window and down to the place where you need the x & y values for. While dragging, you'll see that macOS shows you the relative x & y coordinates.

                        Note, that for most apps that support UI automation, like Pro Tools, Logic, any app made by Apple, iZotope RX, and many others - you don't need to find mouse coordinates. It's only for apps like Cubase and Nuendo that don't support UI automation.

                        If you're looking for a more generic and flexible way to get mouse coordinates for apps like Cubase & Nuendo, you would need image recognition. We'll be adding image recognition support to 4.2, if all goes well.

                        1. SSebastian @Sebastian
                            2020-08-17 07:33:00.889Z

                            Thanks Christian, if not using x/y values whats the best way do get a mouse click in the UAD Console App. I downloaded the UAD Console Package from the Store and I love the Mute Shortcut but would also like to have a shortcuts for ALT 1 and ALT 2 and possible one with ALT1 in combination with DIM.

                            1. Unfortunately, I don't have the UAD software myself, so I can't help you much with it directly.
                              I would highly recommend watching the two last videos in our Learning SoundFlow tutorial playlist on YouTube here:
                              https://www.youtube.com/playlist?list=PLKWpZOwx5Z3jxnpNo_dQPhDQNRwp7DCNj

                              They'll teach you how to use UI automation. If this is possible to use with UAD, then that's preferable, but since I don't have UAD, I can't test it myself.