No internet connection
  1. Home
  2. Ideas

Record mode for discovering underlying button names

By Chris Winter @Chris_Winter
    2020-06-05 04:38:30.772Z

    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.

    • 16 replies
    1. 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.

      1. CChris Winter @Chris_Winter
          2020-06-06 02:12:19.806Z

          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?

          1. CChris Winter @Chris_Winter
              2020-06-06 02:31:18.914Z

              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.

              1. 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.

                1. CChris Winter @Chris_Winter
                    2020-06-06 19:37:02.509Z

                    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.

            • P
              In reply toChris_Winter:
              Paul DeFrancesco @Paul_DeFrancesco
                2020-10-17 00:33:27.073Z

                Hey chris , do you still have this code?

                1. CChris Winter @Chris_Winter
                    2020-10-17 00:42:44.899Z

                    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.

                    1. PPaul DeFrancesco @Paul_DeFrancesco
                        2020-10-17 01:25:06.376Z

                        For some reason the installer is not working in the store.

                        1. CChris Winter @Chris_Winter
                            2020-10-17 02:00:28.808Z

                            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.

                            1. PPaul DeFrancesco @Paul_DeFrancesco
                                2020-10-17 02:08:50.427Z

                                Still did not work, Really apprciate your time .

                                1. CChris Winter @Chris_Winter
                                    2020-10-17 03:25:16.495Z

                                    Want to pm me your email and I’ll forward them to you?

                                    1. PPaul DeFrancesco @Paul_DeFrancesco
                                        2020-10-17 04:05:38.132Z

                                        @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

                                        1. CChris Winter @Chris_Winter
                                            2020-10-17 22:15:07.820Z

                                            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();
                                            `
                              • P
                                In reply toChris_Winter:
                                Paul DeFrancesco @Paul_DeFrancesco
                                  2020-10-18 03:31:25.911Z

                                  Thank you so much I really appreciate you taking out time to send over the script . Have a great weekend.

                                  1. CChris Winter @Chris_Winter
                                      2020-10-18 08:22:44.256Z

                                      No problem. Once we sort the publishing issue you'll have access to all the others too. Watch this space...

                                    • C
                                      In reply toChris_Winter:
                                      Chris Winter @Chris_Winter
                                        2020-10-18 19:14:11.092Z

                                        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.