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
- 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.
- DIn reply toDan_Oxer⬆:Dan Oxer @Dan_Oxer
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
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?
- DIn reply toDan_Oxer⬆:Dan Oxer @Dan_Oxer
sf.ui.proTools.selectedTrack.trackInsertOrSendOpenMenu({ insertOrSend: "Send", pluginNumber: 1, });
- DIn reply toDan_Oxer⬆:Dan Oxer @Dan_Oxer
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 caseKitch 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
Chris Shaw @Chris_Shaw2025-02-28 01:10:27.209Z
FYI - you could replace lines 7-9 with this:
const sendLetter = "abcdefghij"[sendNumber - 1] || null
Kitch Membery @Kitch2025-02-28 01:22:02.451Z
Hundred percent... Was getting too tricky! hahahaha
Updating now.
- DIn reply toDan_Oxer⬆:Dan Oxer @Dan_Oxer
amazing!!! thank you Kitch, you Rock!
By the way, do you know why the Soundflow Command list on Eucontrol. are not in alphabetical order?
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!
- DDan Oxer @Dan_Oxer
Thank you!
I will