No internet connection
  1. Home
  2. How to

Copy region to .LFE track

By Owen Granich-Young @Owen_Granich_Young
    2021-12-06 17:11:05.223Z

    SFX EDITING in a large feature template, multiple FX groups each with a dedicated .LFE mono track at the bottom. I need to be able to quickly paste an element from that group to it's own specific .LFE track

    Here's an example group. All groups are named as such with the first number changing per group number.

    Some of these functions I know I can do, some I don't know how, could ya'll help me out?

    Desired workflow -

    Remember current selection - globalState.previouslySelectedTrackNames = sf.ui.proTools.selectedTrackNames;
    If automation follow edit is on turn automation follows edit off (Don't Know how to do this)
    Copy clip - sf.ui.proTools.menuClick({menuPath: ["Edit","Copy"],});
    Select x.LFE track where X is the current first track number? Or some other more universal detector? (No idea how to do this)
    Paste Clip- sf.ui.proTools.menuClick({ menuPath: ["Edit","Paste"], });
    Re-select orginal track - sf.ui.proTools.trackSelectByName({ names: globalState.previouslySelectedTrackNames, deselectOthers: true });
    If Automation follows edit was on turn back on - (no clue)

    Can someone help me fill in the blanks?

    Thanks!
    Owen

    Solved in post #2, click to view
    • 3 replies
    1. samuel henriques @samuel_henriques
        2021-12-06 20:47:30.094Z

        Hello Owen Granich-Young,

        Try this.

        sf.ui.proTools.appActivateMainWindow();
        sf.ui.proTools.invalidate();
        
        // Get current state of Automation Follows Edit
        const isAutomationFollowEditOn = sf.ui.proTools.getMenuItem("Options", "Automation Follows Edit").isMenuChecked
        
        // Get selected Track
        const selectedTrackName = sf.ui.proTools.selectedTrackNames[0]
        
        // Get LFE's track name based on selected track
        const lfeTrackName = selectedTrackName.split(".")[0] + ".LFE"
        
        // Disable Automation Follows Edit
        if (isAutomationFollowEditOn) { sf.ui.proTools.menuClick({ menuPath: ["Options", "Automation Follows Edit"], targetValue: "Disable" }) }
        
        ///Copy
        sf.ui.proTools.menuClick({ menuPath: ["Edit", "Copy"] })
        
        //Select LFE track
        sf.ui.proTools.trackSelectByName({ names: [lfeTrackName] })
        
        //Paste
        sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"] })
        
        // Select Original selectd track
        sf.ui.proTools.trackSelectByName({ names: [selectedTrackName] })
        
        
        // If  Automation Follows Edit was Enable, Enable it. 
        if (isAutomationFollowEditOn) { sf.ui.proTools.menuClick({ menuPath: ["Options", "Automation Follows Edit"], targetValue: "Enable" }) }
        
        
        // If it can't find the track name for the LFE, the scipt wont fail. So this will let you know why it didn't paste the clip.
        // This could be earlier in the code, but would make it slower. This way you'll never notice the lag for checking the name.
        if (sf.ui.proTools.visibleTrackNames.indexOf(lfeTrackName) == -1) { alert(`Could not find track name ${lfeTrackName}`) }
        
        Reply1 LikeSolution
        1. Flawless as always boss! Thank you!!!

          1. samuel henriques @samuel_henriques
              2021-12-06 23:28:28.479Z

              🤘🤘