No internet connection
  1. Home
  2. How to

How can I move the mouse cursor to an active fader window in Pro Tools?

By Dan Oxer @Dan_Oxer
    2025-02-27 18:44:59.565Z2025-02-27 19:06:42.713Z

    Hi
    How can I move the mouse cursor to an active fader window in Pro Tools?
    If I can use Mouse Cilck Relative to UI Element, why not move the Muse cursor there too?

    Thanks

    Solved in post #7, click to view
    • 11 replies
    1. Kitch Membery @Kitch2025-02-27 19:50:59.650Z

      Hi @Dan_Oxer

      Could you provide some context on the full workflow you're attempting to achieve? Mouse simulation can certainly be facilitated with SoundFlow, but keep in mind that mouse (and keyboard) simulation is the least reliable method of automating with SoundFlow.

      1. D
        In reply toDan_Oxer:
        Dan Oxer @Dan_Oxer
          2025-02-27 21:07:04.046Z

          Hi Kitch, thanks for your reply

          I made a script to open certain sends. so then I want the mouse cursor from whatever location it is to move to the center of the Fader Send that I just opened

          thanks

          1. Kitch Membery @Kitch2025-02-27 21:13:29.265Z

            Thanks for that context... That makes sense and can most certainly be done.

            Can you share the script you have so far?

          2. D
            In reply toDan_Oxer:
            Dan Oxer @Dan_Oxer
              2025-02-27 21:39:00.524Z
              sf.ui.proTools.selectedTrack.trackInsertOrSendOpenMenu({
                  insertOrSend: "Send",
                  pluginNumber: 1,
              });
              
              1. D
                In reply toDan_Oxer:
                Dan Oxer @Dan_Oxer
                  2025-02-27 21:39:37.322Z2025-02-27 21:49:31.115Z

                  I did this for now as is a flexible way to expand to new routing possibilities, so when I finally I decide to open a specific send, I want the mouse to go for example to the middle of the fader of the send I just opened

                  I also can use Shift+1
                  so I need that script to have the flexibility to move it to the send Fader in this case

                  1. Kitch Membery @Kitch2025-02-28 00:04:20.472Z2025-02-28 01:23:00.159Z

                    Hi @Dan_Oxer

                    Try this script. :-)

                    function focusSendFader({ sendNumber }) {
                        // Ensure the Pro Tools main window is active
                        sf.ui.proTools.appActivateMainWindow();
                    
                        // Get the corresponding letter for the send number
                        // Convert number to corresponding letter (1 = 'a', 2 = 'b', etc.)
                        const sendLetter = "abcdefghij"[sendNumber - 1] || null;
                    
                        // Toggle the send visibility for the selected track
                        sf.ui.proTools.selectedTrack.trackSendToggleShow({ sendNumber });
                    
                        if (sf.ui.proTools.mainTrackOutputWindow.exists) {
                            // Wait for the output window to open and validate that the correct send is displayed
                            sf.waitFor({
                                callback: () => {
                                    const outputViewSelector = sf.ui.proTools.mainTrackOutputWindow.buttons.whoseTitle.is("Output View selector").first;
                                    return outputViewSelector.value.invalidate().value === `send ${sendLetter}`;
                                },
                                timeout: 2000,
                            }, `Send Number ${sendNumber}'s output window did not open.`);
                    
                            // Locate the volume slider
                            const volumeSlider = sf.ui.proTools.mainTrackOutputWindow.sliders.whoseTitle.is("Volume").first;
                            // Get the frame of the slider
                            const sliderFrame = volumeSlider.frame;
                    
                            // Calculate the center position of the volume slider
                            const targetMousePosition = {
                                x: sliderFrame.x + (sliderFrame.w / 2),
                                y: sliderFrame.y + (sliderFrame.h / 2),
                            };
                    
                            // Move the mouse to the calculated position
                            sf.mouse.setPosition({ position: targetMousePosition });
                    
                            // Click the volume numerical text field to activate it (Uncomment this line if you want to be able to scroll your mouse to change the sennd volume)
                            //sf.ui.proTools.mainTrackOutputWindow.textFields.whoseTitle.is("Volume Numerical").first.elementClick();
                        }
                    }
                    
                    focusSendFader({ sendNumber: 1 });
                    

                    UPDATED

                    Reply1 LikeSolution
                    1. FYI - you could replace lines 7-9 with this:

                      const sendLetter = "abcdefghij"[sendNumber - 1] || null
                      
                      1. Kitch Membery @Kitch2025-02-28 01:22:02.451Z

                        Hundred percent... Was getting too tricky! hahahaha

                        Updating now.

                  2. D
                    In reply toDan_Oxer:
                    Dan Oxer @Dan_Oxer
                      2025-02-28 00:45:36.276Z

                      amazing!!! thank you Kitch, you Rock!

                      By the way, do you know why the Soundflow Command list on Eucontrol. are not in alphabetical order?

                      1. Kitch Membery @Kitch2025-02-28 01:18:13.286Z

                        Hi @Dan_Oxer

                        You're welcome. I'm glad it worked!

                        Regarding the Soundflow Command list in Eucontrol not being in alphabetical order, to avoid confusion, please start a new thread for that, and in the thread, be sure to provide a screenshot of what you're seeing.

                        On a side note... When responding to replies in forum threads, to ensure that I receive a notification of your response, please use the "Reply" button associated with the reply to which you are responding. :-)

                        Thanks in advance!

                        1. DDan Oxer @Dan_Oxer
                            2025-02-28 02:38:27.355Z

                            Thank you!

                            I will