No internet connection
  1. Home
  2. Macro and Script Help

Export Clips as Files error and does not end up in the Bounce Files folder

By Chris Landon @Chris_Landon
    2024-03-18 22:46:11.161Z

    Title

    Export Clips as Files error and does not end up in the Bounce Files folder

    What do you expect to happen when you run the script/macro?

    This macro is suppose to "Export Clips as Files" and export it to the Bounced Files folder.

    1- Open Pro Tools Session
    2- Click on an stereo audio clip

    When I click on this macro, it is suppose to "Export Clips as Files" and export the clip to the Bounced Files folder but it displays an error and strange overlapping UI artifacts.

    Are you seeing an error?

    The error is...

    Could not find "Go to" sheet in the Save/Open dialog (Export Clips as Files...: Line 74)

    What happens when you run this script?

    When I run the macro, I get an error and overlapping UI artifacts and it doesn't complete what's it's suppose to do.

    How were you running this script?

    I clicked the "Run Script" or "Run Macro" button in SoundFlow

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "This macro is suppose to \"Export Clips as Files\"  and export it to the Bounced Files folder.\n\n1- Open Pro Tools Session\n2- Click on an stereo audio clip\n\nWhen I click on this macro, it is suppose to \"Export Clips as Files\"  and export the clip to the Bounced Files folder but it displays an error and strange overlapping UI artifacts.\n",
        "inputIsError": true,
        "inputError": "The error is...\n\nCould not find \"Go to\" sheet in the Save/Open dialog (Export Clips as Files...: Line 74)",
        "inputWhatHappens": "When I run the macro, I get an error and overlapping UI artifacts and it doesn't complete what's it's suppose to do.",
        "inputHowRun": {
            "key": "-MpfwYA4I6GGlXgvp5j1",
            "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow"
        },
        "inputImportance": 5,
        "inputTitle": "Export Clips as Files error and does not end up in the Bounce Files folder"
    }

    Source

    //Macro converted to script
    
    
    //Calling command "Export Clips as Files..." from package "Pro Tools Windows" (installed from user/pkg/version "K7sfAMoyAGZQwwIp4xruZTGNFTb2/ckq9yuiw90000el10cubh258j/ckrq9mobx00024a10xkratjvz")
    sf.soundflow.runCommand({
        commandId: 'user:cksecvac600013a10aa2ezo8m:ckqar4a6u0001my107y72u4c3',
        props: {
            fileType: "WAV",
            format: "Interleaved",
            bitDepth: "24 Bit",
            sampleRate: "48 kHz",
            enforceAvid: "Disable",
            publishingOptionsDismiss: true,
            bouncedFilesFolder: true,
            resolveDuplicate: "prompting",
            dismissMP3Window: true,
        }
    });
    
    
    

    Links

    User UID: Nob3DYx0X6OinyxMUBK0Zgshm7O2

    Feedback Key: sffeedback:Nob3DYx0X6OinyxMUBK0Zgshm7O2:-NtIjaRwurMJsrI6Zm0f

    Feedback ZIP: gId7vy/zCnV8CoGLg6K+LmpOz4MIVRCTwsxYvRdiA02AwZdPBWhAsxy6pA2lOUyW/hdmtJPaJbVhqvayXNKYpPUe7VBaUcsEdD7dR6K6aVUuFEKxX2CeO+baeyAddZdpDXq3Jrf/eqyQVgO1II7mcf8YYg1Ukq+QZbeDBFBXbCs8UM9kVLYMy9uf3qSrIEYnF9UMzZ4Ki7wqSdr97vzn2/37DDzNe9iYOUnWybBVr8Sn6B5eMQ7Gy4M53Tx7UEnAka+YaF3KmOPiAC0wOhxOrbtp/fvBdYvIAS2cR9zeN39gF/lY//6PLmBPiYOnPgJamTEVD7VowUSnwPrh5luki5iJAAtg5OdxrIQ7pWXNmQA=

    • 20 replies

    There are 20 replies. Estimated reading time: 13 minutes

    1. Thanks! Looks like this package was made by @samuel_henriques

      1. CChris Landon @Chris_Landon
          2024-03-19 01:42:16.498Z

          Yes, it is from Sam and I hope he will chime in and let me know how to fix this :) Thanks, Christian!

          1. samuel henriques @samuel_henriques
              2024-03-19 09:46:35.030Z

              Hello Chris,

              I've updated to the last function for the go to sheet I was using, before the pro tools skd.
              It works here.
              In time i'll replace this thing for the sdk witch is so much better.

          2. C
            In reply toChris_Landon:
            Chris Landon @Chris_Landon
              2024-03-19 12:08:41.043Z

              Hi Samuel,

              I appreciate you getting back to me. If I understand you correctly, you managed to get it working on your end and I just updated the Pro Tools Windows from the SoundFlow Store but when running the macro, I'm still getting the error and the strange overlapping issues when "Export Clips as Files". This time, I received another error. I'm not sure if I'm doing anything wrong here or if something still isn't working properly with the code. Any other advice you can send my way? Thanks!

              1. samuel henriques @samuel_henriques
                  2024-03-19 12:45:30.126Z2024-03-19 12:54:56.922Z

                  are you on pt 2024.3 and you don't need mp3 option?

                  1. samuel henriques @samuel_henriques
                      2024-03-19 13:06:51.198Z2024-03-21 17:04:32.436Z

                      Before I have time to remake the old one.
                      Here's what i'm using now

                      /// If Export clips win doesn't open, try to show audio and Auto-Created & try again
                      function setClipListViews() {
                          function clipListPopupMenu(path) {
                              sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({
                                  menuPath: path, targetValue: "Enable"
                              });
                          }
                          // Get clip list open/closed
                          const clipListWasClosed = sf.ui.proTools.getMenuItem("View", "Other Displays", "Clip List").isMenuChecked
                      
                          /// Show audio and auto-created
                          sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Enable" });
                      
                          let enableViewMenus = [
                              ["Clear Find"],
                              ["Show", "Audio"],
                              ["Show", "Auto-Created"],
                          ]
                          enableViewMenus.forEach(clipListPopupMenu)
                      
                          //  If clear find was needed, the clips need to be selected again so they get selected on the clip list
                          const selectedTracks = sf.ui.proTools.selectedTrackNames
                          sf.ui.proTools.trackDeselectAll()
                          sf.ui.proTools.trackSelectByName({ names: selectedTracks })
                      
                          // count selected clips on clip list
                          let clipsTable = sf.ui.proTools.mainWindow.tables.whoseTitle.is('CLIPS').first;
                          let selectedClipCount = clipsTable.getElements("AXSelectedRows").allItems.length;
                      
                          if (selectedClipCount === 0) {
                              alert('Please select at least one hole clip to export and try again.')
                              throw 0
                          }
                      
                          // Set clip list open/closed as it was
                          if (!clipListWasClosed) sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Disable" });
                          // reset menus
                          sf.keyboard.press({ keys: 'n', fast: true, repetitions: 2 });
                      
                      };
                      
                      
                      
                      
                      /**
                       * Export clips as files settings
                       * @param {Object} options
                       * @param {'WAV'|'AIFF'|'MXF'} [options.userFileType='WAV'] - Default is 'WAV'.
                       * @param {'Interleaved'|'Mono'|'MultipleMono'|'None'} [options.userFormat='Interleaved'] - Default is 'Interleaved'.
                       * @param {'Bit24'|'Bit16'|'BitNone'|'Bit32Float'} [options.userBitDepth='Bit24'] - Default is 'Bit24'.
                       * @param {44100|48000|96000|192000} [options.userSampleRate=48000] - Default is 48kHz. - Sample Rate Custom PT 2023.3+ only!!
                       * @param {string} [options.userLocation] - Default is session Bounced Files folder.
                       * @param {boolean} [options.showSuccess=false] - Default is false.
                       */
                      function exportClipsAsFiles({ userFileType, userFormat, userBitDepth, userSampleRate, userLocation }) {
                      
                      
                          userLocation ? userLocation : userLocation = sf.ui.proTools.mainWindow.sessionPath.split('/').slice(0, -1).join('/') + '/Bounced Files';
                      
                          let hasClipSelection = sf.app.proTools.getSelectedClipInfo().clips.length > 0
                          if (!hasClipSelection) { throw 'Please select a clip to export.' }
                      
                          // Failsafe to meke sure clips are selected on clip list. If not sf.app.proTools.exportClipsAsFiles will fail without warning.
                          let isClipSelectedOnClipList = sf.app.proTools.getFileLocation({ fileFilters: ["SelectedClipsTimeline"] }).fileLocations.length > 0
                          if (!isClipSelectedOnClipList) {
                              setClipListViews();
                          };
                      
                      
                          // Get current files on userLocation
                          const pathsOnUserLocation = () => sf.file.directoryGetFiles({ path: userLocation }).paths
                      
                          let originalPaths = pathsOnUserLocation()
                      
                          sf.app.proTools.exportClipsAsFiles({
                              bitDepth: userBitDepth,
                              fileType: userFileType,
                              format: userFormat,
                              sampleRate: userSampleRate,
                              targetDirectory: userLocation,
                          })
                      
                      
                          //Check success
                          const nowPaths = pathsOnUserLocation()
                          let newPaths = nowPaths.filter(p => !originalPaths.includes(p));
                          //let newFileNames = newPaths ? newPaths.map(p => p.split("/").slice(-1).join()) : null
                          if (newPaths.length === 0) throw 'Export not successful.'
                      };
                      
                      
                      
                      exportClipsAsFiles({
                          userFileType: "WAV",
                          userFormat: "Interleaved",
                          userBitDepth: "Bit24",
                          userSampleRate: 48000,
                          userLocation: sf.ui.proTools.mainWindow.sessionPath.split('/').slice(0, -1).join('/') + '/Bounced Files'
                      })
                      

                      This will export wav interleaved 24/48 to the bounced files folder

                      This function checks if there aren't any file selected on the clip list, and makes the list visible so pro tools lets yo export anything.

                      Let me now if this helps.

                  2. C
                    In reply toChris_Landon:
                    Chris Landon @Chris_Landon
                      2024-03-19 13:52:43.136Z

                      I am using PT 2024.3, macOS 14.3.1 and I'm not quite sure what you mean by not needing an MP3 option. Although, as well as creating a macro for "Export Clips as Files WAV 24/48", and "Export Clips as Files WAV 16/48", I also would like to create a macro for "Export Clips as Files MP3 16/44". All the info you sent me, Samuel, I appreciate you going out of your way but I know very little in regards to coding, scripts, etc. This is why I use others from the store rather than make my own. I am learning though :) Also, when I hover my mouse on the property to see its options, nothing happens. I wish I could say this helped me but unfortunately, things are going the way I'd hoped for. Thank you.

                      1. samuel henriques @samuel_henriques
                          2024-03-19 15:12:12.962Z

                          Not a problem at all,
                          When I'm back on my computer I'll send you the setup for WAV 24/48.
                          What I meant when asked if you need the MP3 option is if you need to export MP3. As this script doesn't allow this, since avid didn't provide this yet.
                          That means as well, we'll have to figure out why the original script doesn't work, or make you one.

                          1. CChris Landon @Chris_Landon
                              2024-03-19 23:27:40.647Z

                              Thanks so much, Samuel. I appreciate your wanting to send over the setup for WAV 24/48. Regarding the MP3 Option, I see it in the menu (see screenshot). I assume this won't work with the latest version of Pro Tools?

                              1. samuel henriques @samuel_henriques
                                  2024-03-20 20:47:23.023Z

                                  Hello Chris
                                  I've updated above with the settings as you asked.

                                  Could you please double check if you have the latest version of the package on the sf store? should be 1.2.5.

                                  1. CChris Landon @Chris_Landon
                                      2024-03-20 22:58:39.714Z

                                      Hi Samuel,

                                      Thanks so much for getting the script to work but I believe there's one issue. When Exporting Clips as FIles, instead of having an Interleave file, which is what I have it set up to, I get (Multiple) Mono. I am running 1.2.5. Any reasons why?

                                      1. samuel henriques @samuel_henriques
                                          2024-03-20 23:00:55.493Z

                                          ah wait, so what you are using the templates from the store, and it's working?

                                          1. CChris Landon @Chris_Landon
                                              2024-03-20 23:06:36.476Z

                                              I installed 1.2.5 as you instructed and it does seem to work but as I mentioned before, the Export is wrong. I need Interleaved files and not (Multiple) Mono. As you can in the screenshot, I do have it set to Interleaved. Thanks!

                                              1. samuel henriques @samuel_henriques
                                                  2024-03-20 23:07:15.207Z

                                                  the only way I can reproduce it here is,
                                                  if i get two mono files and drag them to a stereo track, and export as interleaved, i get two mono files.

                                                  1. CChris Landon @Chris_Landon
                                                      2024-03-20 23:10:07.643Z

                                                      So you can reproduce this as well. Is there any way of having Interleaved files when Exporting? I remember this working before Sonoma/Pro Tools Native Silicon.

                                                      1. samuel henriques @samuel_henriques
                                                          2024-03-20 23:13:31.496Z

                                                          if I consolidate the clip on the stereo track, it will become stereo, and then pro tools will export interleaved

                                                          1. CChris Landon @Chris_Landon
                                                              2024-03-20 23:53:27.866Z

                                                              Sorry for the late responses, Samuel. I'm working with a client as we speak... The clips that I am exporting are also stereo files but they export as Multiple Mono in the Bounced Files folder. I don't understand why this happens on my end when all is fine on yours.

                                                              1. samuel henriques @samuel_henriques
                                                                  2024-03-20 23:56:58.998Z

                                                                  If you do it manually on pro tools does it export interleaved?

                                                                  1. CChris Landon @Chris_Landon
                                                                      2024-03-21 00:07:32.878Z

                                                                      Meaning without using SF, yes it does export Interleaved but I just tried creating another shortcut and now it works. I'm not sure why the other Action did not work or what's going on just yet but I'll have more free time later tonight and I'll continue testing. It may just be a glitch with the latest SF 5.7.1. Thanks again, Samuel, and I'll be back later and let you know how things are going.

                                                                      1. CChris Landon @Chris_Landon
                                                                          2024-03-21 07:31:29.867Z

                                                                          Hi Samuel, thank you so much for helping me out by updating your script. So far, everything seems to be working perfectly and I'm sure others will appreciate it too. Cheers!