No internet connection
  1. Home
  2. How to

Adding track commit and track rename to RS_Recall Track Preset script

By Gary Philips @Gary_Philips
    2023-01-26 22:45:32.384Z

    I've got a keyboard trigger to load a specific track preset from the @raphaelsepulveda package (RS_Recall Track Preset), but I'd like to make a new more specific version that will first Commit and then Rename the newly committed track before then loading the track preset. Can anyone help me out with how to accomplish this? Thanks!

    • 4 replies
    1. Hey @Gary_Philips,

      You can combine all three of these steps as follows:

      • Create a new script command for the Commit script. Here's a good one you can customize to your needs. Test it and make sure it works as you expect it to before moving on—How to commit tracks (and more) #post-8
      • Create another new script command for renaming. You can use this simple script for that. I'm assuming you'll like to remove the ".cm" part, so what this is doing is just replacing it with a blank space. Again, test to make sure it works correctly on its own.
      sf.ui.proTools.selectedTrack.trackRename({
          renameFunction: oldName => {
              const newName = oldName.replace(".cm", " ");
              return newName;
          }
      });
      
      • And for the final step, make a new macro command, pin it, and go to each of the two script commands you created in the previous steps and drag them into this macro. Then go to the RS_Recall Track Preset command and drag that in too. Alternatively, you can add this last one through the "+ Add Action" button and searching for it. Now you can use this macro to invoke all three commands in that order.

      And that should do it!

      Let me know if that makes sense.

      1. Gary Philips @Gary_Philips
          2023-01-27 23:15:23.051Z

          Incredible. Thanks so much -- and I learned a lot just following your instructions, so thank you! One additional question if you have a moment -- how would I adjust the code in the Rename script so that changes the track to a specified name like "Stem1"

          1. Gary Philips @Gary_Philips
              2023-01-28 03:31:13.079Z

              Holy smokes I think I just figured it out myself by replacing oldName with "Stem1"
              You rock Raphael