No internet connection
  1. Home
  2. Support

Soundflow Can't See Edit Window for Script

By Justin Hernandez @Justin_Hernandez
    2025-03-29 18:45:42.269Z

    Title

    Soundflow Can't See Edit Window for Script

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

    I just downloaded Soundflow and I cant seem to get any script to read information from the track list. I've checked permissions, reinstalled, but i continued to get errors related to Soundflow not being able to see the edit window. Thanks!

    Are you seeing an error?

    Cannot read property 'invalidate' of undefined

    What happens when you run this script?

    I'm really just trying out the software for the first time. My goal would be to automate something to be able to rename tracks, color code based off track name, but I cant seem to even get it to see the tracks.

    How were you running this script?

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

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "I just downloaded Soundflow and I cant seem to get any script to read information from the track list. I've checked permissions, reinstalled, but i continued to get errors related to Soundflow not being able to see the edit window. Thanks!",
        "inputIsError": true,
        "inputError": "Cannot read property 'invalidate' of undefined ",
        "inputWhatHappens": "I'm really just trying out the software for the first time. My goal would be to automate something to be able to rename tracks, color code based off track name, but I cant seem to even get it to see the tracks. ",
        "inputHowRun": {
            "key": "-MpfwYA4I6GGlXgvp5j1",
            "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow"
        },
        "inputImportance": 4,
        "inputTitle": "Soundflow Can't See Edit Window for Script"
    }

    Source

    // Refresh Pro Tools UI to ensure SoundFlow can access it
    sf.ui.proTools.invalidate();
    
    // Give SoundFlow time to catch up
    sf.wait({ milliseconds: 500 });
    
    // Now try to access the track list safely
    if (!sf.ui.proTools.trackList || !sf.ui.proTools.trackList.exists) {
        throw new Error("Pro Tools track list not found. Make sure the Edit window is open and Pro Tools is active.");
    }
    
    // Grab all tracks
    const tracks = sf.ui.proTools.trackList.tracks;
    
    // Orange is typically around index 11, but this may vary depending on theme
    const ORANGE_INDEX = 11;
    
    tracks.forEach(track => {
        try {
            track.trackColorButton.popupMenuSelect({
                menuPath: ["Color", "Color Palette", `Color ${ORANGE_INDEX}`],
            });
        } catch (err) {
            log(`Track "${track.name.value}" failed: ${err.message}`);
        }
    });
    

    Links

    User UID: ZQY6MaMEkdc43Dq3AufBSCH9yUq1

    Feedback Key: sffeedback:ZQY6MaMEkdc43Dq3AufBSCH9yUq1:-OMYDKmI1KAKFkvXtJcX

    Feedback ZIP: dlsuvr9IERJu4SnCnHe3BwmkuwMAPnpKniNJIlSGqeifN58nd7INy2m1EkMYtzJpcYXpBpGB4lGB+j3ilHb5kysK+jdi1OmH/epIhleTqxsyqqChyDFddrIe0DkgDbeYTSr2/421+O3y0xovJWYxAQTfrm1O+rt/P/QT2NZgf6dMJqa1LCq9s3N0t+1bXNlRQ1pDIJNje4r5NTNASmSnu13y9EfmZp9k1W1wxLwyhKX8pOQBaW+VkjEoHPY7laGKeiLz7ZJvMD/pvR/jOmAJGPgYlzEKW9xotxBl6KQJ3kVmkeGmZmPsBA4EOBTvl5hu+6yOvYXyYaupBQSvclyA7+L79h7cUBCyGNFBZTu/SCc=

    • 2 replies
    1. Hi Justin,

      There's no property called trackList in the main Pro Tools object (sf.ui.proTools). Did you write this script yourself or was this written by AI? You will see a red underline in the SF editor in the code you've shared here indicating the errors.

      The script also seems to be inventing a popup menu which doesn't exist.

      I'd highly recommend trying to do some searches here in the forum - there are lots of examples of how to iterate through either all visible tracks, or selected tracks, for example, depending on what you intend to do.

      Here's an example that combines some of the new Pro Tools SDK functions to iterate through all tracks, and then a UI automation based action for setting the color palette.

      
      // Loop through all tracks
      for(let track of Array.from(sf.app.proTools.tracks.invalidate().allItems))
      {
          // Select this track
          sf.app.proTools.selectTracksByName({
              trackNames: [track.name],
          });
      
          // Do something with the track, in this case, we're choosing the track color
          sf.ui.proTools.colorsSelect({
              colorNumber: 11,
              colorBrightness: 'Medium',
              colorTarget: 'Tracks',
              colorType: 'Color',
          });
      }
      
      
      1. JJustin Hernandez @Justin_Hernandez
          2025-03-30 15:49:03.322Z

          Thank you!! I started going through the forums after submitting this and have learned a lot. Excited to continue using this and will definitely be subscribing after the trial, thank you for the quick response!