No internet connection
  1. Home
  2. Support

Store and Recall Tracks Selection - Multiple Banks - Temp Selections

By Kaspar @Kaspar
    2025-04-28 14:42:29.142Z

    Title

    Store and Recall Tracks Selection - Multiple Banks - Temp Selections

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

    Soundflow for storing and then recalling a selection of tracks.

    Works as expected but would like to know if its possible to store and restore multiple selections almost like temp markers.

    The script currently overwrites the selection as I understand it.

    Are you seeing an error?

    What happens when you run this script?

    Would like to have multiple store and recalls

    Eg

    Save x selected tracks to bank 1

    Save y selected tracks to bank 2

    Run Bank 1 restore soundflow to restore x Tracks selection

    Run Bank 2 restore soundflow to restore y Tracks Selection.

    How were you running this script?

    I used a keyboard shortcut within the target app

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "Soundflow for storing and then recalling a selection of tracks.\n\nWorks as expected but would like to know if its possible to store and restore multiple selections almost like temp markers.\n\nThe script currently overwrites the selection as I understand it.",
        "inputIsError": false,
        "inputWhatHappens": "Would like to have multiple store and recalls\n\nEg\n\nSave x selected tracks to bank 1\n\nSave y selected tracks to bank 2\n\nRun Bank 1 restore soundflow to restore x Tracks selection\n\nRun Bank 2 restore soundflow to restore y Tracks Selection.",
        "inputHowRun": {
            "key": "-Mpfwh4RkPLb2LPwjePT",
            "title": "I used a keyboard shortcut within the target app"
        },
        "inputImportance": 4,
        "inputTitle": "Store and Recall Tracks Selection - Multiple Banks - Temp Selections"
    }

    Source

        //////// Select track by name using variable selectedTracks
    sf.ui.proTools.trackSelectByName({ names: globalState.selectedTracks })
    
    

    Links

    User UID: VsW63KQlOvQ4pS3VRklEUcKKQz42

    Feedback Key: sffeedback:VsW63KQlOvQ4pS3VRklEUcKKQz42:-OOwqMWHnYtXV7L6mXTR

    Feedback ZIP: L9jA08+gu1Ib0fgXadp6hhXzCj9rCr9ZKjCMHLHN0xQTUG1rcpugqVmfDw9V9jf4piWtnxtO8X6JK4ThDRQkdPeVn9P/CJnq0BC52/uVdi+XnjlvmSjNLmELeZaeWAHhLB27v7nc3eVan49LJP1MLoH/zwGI3yAFKsX0nq4fJ/JKSivNce+2zLd/UBg94QWaI+mLVhsdKOvpqFgVZ9f8kJkd0/sZLr+JYYc3c8lhJAQxxpBSnRXxYTyB4/4GcmHUtZKtG4DhVvVFBNPIkH7lTYvQZ7TBPFnvElUet6/0DmixDMyqIXqIDvrlroW3iz41wSX8dNBKd3tg0vd8Qo8eo/287cb6ukQ3UB0cANzLEa4=

    Solved in post #3, click to view
    • 5 replies
    1. Kitch Membery @Kitch2025-04-28 22:24:00.993Z

      Hi @Kasper,

      Yes, this can be done. I'll take a look at this today and get back to you.

      1. Kitch Membery @Kitch2025-04-29 20:37:37.633Z

        Hi @Kasper,

        This could be optimized, but to cover the basics, you could have four commands as follows.

        • Store Bank 1 Track Names - This script will store the selected track names you want to recall for bank 1
        const tracks = sf.app.proTools.tracks.invalidate().allItems;
        const selectedTrackNames = tracks
            .filter(t => !t.isHidden && t.isSelected)
            .map(t => t.name);
        
        globalState.trackBank1 = selectedTrackNames;
        
        • Store Bank 2 Track Names - This script will store the selected track names you want to recall for bank 2
        const tracks = sf.app.proTools.tracks.invalidate().allItems;
        const selectedTrackNames = tracks
            .filter(t => !t.isHidden && t.isSelected)
            .map(t => t.name);
        
        globalState.trackBank2 = selectedTrackNames;
        
        • Recall Bank 1 Tracks - This script will select the tracks stored in Bank 1
        sf.app.proTools.selectTracksByName({trackNames:globalState.trackBank1});
        
        • Recall Bank 2 Tracks - This script will select the tracks stored in bank 2
        sf.app.proTools.selectTracksByName({trackNames:globalState.trackBank2});
        

        These could also be combined into a command template for expanding track selections.

        Please note that globalState variables reset when SoundFlow is restarted, so if you need the Bank's track names to persist across multiple sessions, you may be better off storing the track names in a JSON file on your computer.

        I hope that helps. :-)

        Reply1 LikeSolution
        1. KKaspar @Kaspar
            2025-05-01 09:30:37.777Z

            Thank you Kitch this works great :)

            Cheers!

          • In reply toKitch:
            KKaspar @Kaspar
              2025-05-01 11:26:46.492Z

              @Kitch For the recall tracks - what would be the best way to scroll these into view as well?

              I suppose in theory they may not all fit into the window - So might have to be scrolling to the top track in the bank if that's possible?

              Thanks

              Kaspar

              1. Kitch Membery @Kitch2025-05-01 16:39:16.636Z

                Hi @Kaspar

                This is untested but should do the trick.

                For recalling Bank 1.

                const targetTrackNames = globalState.trackBank1;
                
                if (targetTrackNames && targetTrackNames.length > 0) {
                
                    sf.app.proTools.selectTracksByName({ trackNames: targetTrackNames });
                
                    sf.ui.proTools.trackGetByName({ name: targetTrackNames[0] }).track.trackScrollToView();
                }
                

                And for recalling Bank 2.

                const targetTrackNames = globalState.trackBank2;
                
                if (targetTrackNames && targetTrackNames.length > 0) {
                
                    sf.app.proTools.selectTracksByName({ trackNames: targetTrackNames });
                
                    sf.ui.proTools.trackGetByName({ name: targetTrackNames[0] }).track.trackScrollToView();
                }
                

                :-)