No internet connection
  1. Home
  2. How to

Duplicate Track, Select All. First clip gets trimmed.

By Arvid van den Bosch @Arvid_van_den_Bosch
    2023-03-10 09:42:58.148Z

    Hi everyone!

    Still working on my Bounce Workflow, awesome so far!
    I discovered a weird thing that took me some time to fix. Maybe someone expierences the same thing.

    I have the following script to duplicate a track and after that select all the clips on the new track.
    The tracks duplicates fine but when all the clips are selected, the first clip gets trimmed on beginning. When I want to undo I can undo "Trim Start to Insertion", which is normally under your 'A' Key in Pro Tools. I noticed that the clip was trimmed to the point where i left the cursor/playhead.

    It feels like the Select All command tries to press 'cmd+A' but the cmd doesn't come across.
    This is my script:

    sf.ui.proTools.appActivateMainWindow();
    
    sf.ui.proTools.trackDuplicateSelected();
    sf.ui.proTools.menuClick({menuPath: ["Edit", "Select All"]});
    

    I've added some screenshots to show what happens.

    This is the inital state of the session:


    After the script ran, this is the result:
    This is what Pro Tools shows as the undo option:
    The way to fix this for me was to set the cursor to the start of the first clip before duplicating:
    sf.ui.proTools.appActivateMainWindow();
    
    sf.keyboard.press({keys: 'enter'})
    sf.keyboard.press({keys: 'tab'})
    
    sf.ui.proTools.trackDuplicateSelected();
    sf.ui.proTools.menuClick({menuPath: ["Edit", "Select All"]});
    

    Maybe this will help someone age a little less quicker :)

    Erik

    PS: I tried to submit this post in the 'Macro and Script help' category but I got this error:

    'May not create a page in this category [EdE5KW20A-EdEMN0CR-TyMMBYSEE_-TyMMBYSEE_-TyMMMSSEMGD-TyMMBYSEE_-EdMMSEEADDCATPERM-TyMMSEEMRGCATPRM]'
    • 0 replies