Record mode for discovering underlying button names
Hi, I've been trying to script button clicks in specific Audiosuite plugins inside ProTools, but it seems clunky. It would be awesome if SF had some way of being able to record an action or a click on a plugin, then print the results of the button names etc so we can access them directly in a script.
- Christian Scheuer @chrscheuer2020-06-05 16:00:48.667Z
Hi Chris,
Unfortunately, Pro Tools doesn't expose the contents of plugins in the same way it does everything else - so this is why it's clunky today.
How are you doing it today? Maybe there's still an easier way that you haven't found yet - but it's easier to help with if we know what exactly you're doing now.
- CChris Winter @Chris_Winter
Hi Christian, yeah after posting I realised it unfortunately wouldn't be an easy fix.
I am trying to create a couple of streamdeck buttons which open VocAlign Pro and first load the current selection into the "Guide" track and secondly load my next selection into the "Dub" track and then process the results.
I'm trying to set mouse click points in the GUI, but am struggling to figure out pixel distances to the elements I'm clicking, and realise it could present issues with plugin windows that I resize etc (not that this applies to VocAlign specifically as it's a constant size).
I'm using the numbers displayed in the OSX built-in screen capture to figure out the distances relative to the top left of the UI element, but I can't seem to find the happy place where it actually clicks the button. Is there some sort of debug mode where I can easily see exactly where the script is clicking at that point in the script?
- CChris Winter @Chris_Winter
I've just figured out what my issue was here and I feel decidedly silly: the SF window was covering the ProTools plugin window, so when I hit the "Run Command" button, it was clicking in SF, not in PT.
I guess I could make sure the app and window are foremost every time, but I'm hoping this will only occur during testing.Christian Scheuer @chrscheuer2020-06-06 17:35:44.385Z
Ah, gotcha. Thanks for the update!
It's always a good idea to use a "Element Raise" action on the window in question to ensure it's not covered by anything else.
- CChris Winter @Chris_Winter
Thank you, I’ll add that.
After an hour of playing around I now have buttons to load into both slots, as well as process automatically, and I also made buttons to move selection up and down and auto-process as well.
So many clicks saved! Thanks.
- PIn reply toChris_Winter⬆:Paul DeFrancesco @Paul_DeFrancesco
Hey chris , do you still have this code?
- CChris Winter @Chris_Winter
Hi Paul,
I published my rudimentary scripts in the repository. They should pop up if you search Vocalign in the SF store.
There are still a few clunky things with them, but I haven’t had a chance to tweak them as I’ve been deep in projects.
- PPaul DeFrancesco @Paul_DeFrancesco
For some reason the installer is not working in the store.
- CChris Winter @Chris_Winter
Just re-published for you and it's not showing up in the store inside the app. It is, however showing up in the app store online: https://soundflow.org/store/vocalign-pro-helpers
Let me know if you are still unable to download them and I'll post the scripts here once I'm back at the studio.
- PPaul DeFrancesco @Paul_DeFrancesco
Still did not work, Really apprciate your time .
- CChris Winter @Chris_Winter
Want to pm me your email and I’ll forward them to you?
- PPaul DeFrancesco @Paul_DeFrancesco
@Chris_Winter for some reason I cant find the pm button in this form can you pm me and I will reply ? Sorry , very new here
- CChris Winter @Chris_Winter
Sorry, that’s probably a wrong assumption on my part.
Apologies for the delay - I've been engrossed in a project.
I have made a couple of wee updates and tried posting again, but it's not showing up in the app again.
I've flicked Christian a note to see what I've done wrong with my publishing, but in the meantime, below is the code for my Capture Dub and Process script, which should at least get you started while I figure out what's going on. Thanks for your patience!// This script will load the current selection in the Pro Tools Edit window into the Dub track in VocAlign Pro and render the auto-aligned audio to the current track. sf.ui.proTools.appActivateMainWindow(); // Check the VocAlign window exists var asWin = sf.ui.proTools.getAudioSuiteWindow("VocAlign Pro"); if (!asWin.exists) { //AudioSuite window isn't open, so open it asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: "Other", name: "VocAlign Pro", }).window; } // Click Dub button to select Dub track sf.ui.proTools.firstAudioSuiteWindow.mouseClickElement({ relativePosition: {"x":30,"y":255}, }); //Check there is a selection made on the current track var selClipCheck = sf.ui.proTools.getMenuItem("Edit", "Separate Clip", "At Transients") if (!selClipCheck.exists) throw "No selection made on destination track." // Click Capture button to load into track asWin.getFirstWithTitleContaining("Analyze").elementClick(); // Wait for a second for the file to load in sf.wait({ intervalMs: 1000, }); // Ensure we're writing to the current track sf.ui.proTools.windows.whoseTitle.is('Audio Suite: VocALign Pro').first.popupButtons.whoseTitle.is('FXGeneralPopup').first.popupMenuSelect({ menuPath: ["no track selected"], }); //Check there is a selection made on the current track var selClipCheck = sf.ui.proTools.getMenuItem("Edit", "Separate Clip", "At Transients") if (!selClipCheck.exists) throw "No selection made on destination track." // Process the file asWin.audioSuiteRender(); // Keep the audiosuite window foremost sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.floatingWindows.whoseTitle.contains('Audio Suite:').first.elementRaise(); `
- PIn reply toChris_Winter⬆:Paul DeFrancesco @Paul_DeFrancesco
Thank you so much I really appreciate you taking out time to send over the script . Have a great weekend.
- CChris Winter @Chris_Winter
No problem. Once we sort the publishing issue you'll have access to all the others too. Watch this space...
- CIn reply toChris_Winter⬆:Chris Winter @Chris_Winter
Looks like the package is now correctly showing up in the store. There are a few more useful scripts in it, so go take a look.