Old 12-17-2015, 01:27 PM   #1
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
Default Scripts to Copy & Paste Track Names?

Hello genius coders, is it script-able to copy the names of a set of selected tracks and then paste the names back to the same or another set of tracks (would be 2 separate scripts to use before and after a set of actions)?

I'm trying to use SWS resources to apply track templates (with track grouping parameters) to selected tracks, but can't prevent them all inheriting the name of the track template.

Thanks for any ideas.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 12-17-2015, 03:04 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Hi,

Yes it is possible, and yes it surely simpler in two scripts (so that it can be set in custom actions as you desired).

Is that something you have to do a lot ?

You have to explain what is considered as source tracks and what is considered as destination tracks so that someone can script something, but in the concept yes, it sounds possible.
X-Raym is offline   Reply With Quote
Old 12-17-2015, 05:03 PM   #3
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
Default

Thanks X-Raym, well right now yea I'm having to do it a lot. Going through and updating tons of old projects to finalize with new practices, VCA's and so forth. Easiest way I've found is to use Resources Track Templates to apply VCA grouping, set inputs and track panel appearance. I can use snapshots to preserve the fx chains, but lose the original track names in the process.

Source and destination tracks are simply the track selection. I would use the scripts in the same custom action most likely always, so both would be the same in any case I imagine.

I've also created a track context toolbar to quickly apply these changes to any selected track(s) for track type consistency and painless VCA assignment, so it's a drag when they all end up with the track template name. That's the only drawback left to this process right now:



If it's easy for you or someone to come up with that would be most helpful, but if you don't have time, it would still be great if you pointed me in the right API direction and I'll attempt something myself.
__________________
foxyyymusic

Last edited by foxAsteria; 12-17-2015 at 06:09 PM.
foxAsteria is offline   Reply With Quote
Old 12-17-2015, 06:09 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Quote:
I'll attempt something myself.
Oh man, if you want to it yourself, I will not push you back
The more users will script, the more fun we will have

Ok so I point you some direction, try, and I help you if you are stuck. I don't know what is your level of programming, so I'll stay concise.

I have a script that take parent track name and set them to uppercase.
REAPER-ReaScripts/X-Raym_Set parents tracks names to uppercase and childs ones to camelcase.lua at master · X-Raym/REAPER-ReaScripts

You can use it as template for both actions. Just clean the parent checking conditions, and replace
GetTrack by GetSelectedTrack
CountTrack by CountSelectedTrack
Then start to code your desired scripts:
  • Save selected tracks names as Proj Exstate
  • Rename selected tracks names from Proj Exstate
So, as you can guess, to save info from a script to another, we will use Proj Exstate, a way to write infos right in the .rpp file. Then we recall them from the second script.


So there is two actions that interest us:
Code:
reaper.SetProjExtState(ReaProject proj, string extname, string key, string value)
To store the track names

Code:
retval, string valOutNeedBig reaper.GetProjExtState(ReaProject proj, string extname, string key)
to recall the values
(or you can use this one - you will have to test to see what is more easy):
Code:
boolean retval, optional string keyOutOptional, optional string valOutOptional reaper.EnumProjExtState(ReaProject proj, string extname, integer idx)
You could probablu use TRACK_NAMES as Extnames and the number in selection as key.



More infos in the doc : REAPER API functions - SetProjExtState


In both scripts, you just have to put one of this actions inside the loop.



Tell me if you succeed to do something (or not).

Cheers !
X-Raym is offline   Reply With Quote
Old 06-01-2016, 02:25 AM   #5
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 610
Default

Hi X-Raym

May I ask for an alternative version of this script ?

Set Parents and NON-FOLDER names to uppercase and child ones to camelcase.lua
mehmethan is offline   Reply With Quote
Old 05-17-2018, 10:14 AM   #6
Vagalume
Human being with feelings
 
Join Date: Nov 2015
Posts: 607
Default

Just wondering if you were able to get the script done ... I have to rebuilt all my templates but I don't want copy the names again ...
Vagalume is offline   Reply With Quote
Old 05-17-2018, 10:38 AM   #7
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Thanks to cfillion we know have a Clipboard function for reascript! No need to use
SetProjExtState in this case anymore.

So you can simply code the script to get selected track names in the clipboard (script 1) and the other to paste names list from the clipboard to selected track (script 2).
X-Raym is offline   Reply With Quote
Old 05-17-2018, 12:23 PM   #8
Vagalume
Human being with feelings
 
Join Date: Nov 2015
Posts: 607
Default

Ty X-Raym, I will have a look ... hope I am able to do something, last time I coded anything was 20 years ago jeje
Vagalume is offline   Reply With Quote
Old 05-17-2018, 12:42 PM   #9
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,271
Default

Quote:
Originally Posted by Vagalume View Post
Just wondering if you were able to get the script done ... I have to rebuilt all my templates but I don't want copy the names again ...
I've given up on learning script for the moment, but for this project I just ended up using a custom action to apply color based on custom colors and vca group based on default group flags. So I didn't need to copy/paste track names anymore.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 05-17-2018, 01:10 PM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Vagalume
Ok let us know how far you. You have access to my youtube reascript video tutorial and to my only reascript api doc if needed :P
X-Raym is offline   Reply With Quote
Old 05-17-2018, 02:03 PM   #11
Vagalume
Human being with feelings
 
Join Date: Nov 2015
Posts: 607
Default

Ty both
Vagalume is offline   Reply With Quote
Old 07-07-2020, 09:13 PM   #12
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default I'd do it if only I could...

Hello

I'm a bit late to the party, sorry, but has someone made a script to get the name of a selected track, and later on copy this name to another newly selected track ?

I won't lie, I'm unable to do it myself (scripting). Usualy I get around these things by doing long and tedious custom actions, but here there is no shortcut & I need this piece of code very much in custom and cycle actions I use all the time. I could even pay a few bucks if this can motivate someone to do it..

Any help appreciated !
Loulou92 is offline   Reply With Quote
Old 07-07-2020, 09:49 PM   #13
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 366
Default

@Loulou92

Archie_Track; Copy selected track name.lua
Archie_Track; Paste selected track name .lua
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate | Donate2 | Donate3 | PayPal |
Archie is offline   Reply With Quote
Old 07-08-2020, 10:13 AM   #14
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Quote:
Originally Posted by Archie View Post
@Loulou92

Archie_Track; Copy selected track name.lua
Archie_Track; Paste selected track name .lua
Thank you so much, my internet ally !!
Loulou92 is offline   Reply With Quote
Old 04-20-2021, 03:22 AM   #15
kris.audioplanet
Human being with feelings
 
Join Date: Feb 2019
Location: Poland
Posts: 137
Default

Is there a way to take a list of track names from a text files (one title per line) and paste them to tracks in reaper?
kris.audioplanet is offline   Reply With Quote
Old 04-20-2021, 10:18 AM   #16
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,721
Default

For those interested... the best basic renamer (for me) is: Script: amagalma_gianfini_Track-Item Name Manipulation - UNDO.lua

__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 04-21-2021, 08:38 AM   #17
AB1
Human being with feelings
 
Join Date: Apr 2020
Location: UK
Posts: 79
Default

Looks like the 'Track-Item Name Manipulation' renaming script has been renamed! Search for 'ReaNamer'.

Quote:
Originally Posted by kris.audioplanet View Post
Is there a way to take a list of track names from a text files (one title per line) and paste them to tracks in reaper?
Yes. Search for 'X-Raym_Import tracks from file.lua' in ReaPack.
AB1 is offline   Reply With Quote
Old 11-25-2023, 02:05 AM   #18
robotron
Human being with feelings
 
Join Date: May 2020
Posts: 337
Default

Quote:
Originally Posted by Archie View Post
@Loulou92

Archie_Track; Copy selected track name.lua
Archie_Track; Paste selected track name .lua
The copy script isn't working for me - clipboard isn't updated, just contains whatever was in there previously.

Reaper 7.05 x64 windows 10.
robotron is offline   Reply With Quote
Old 12-30-2023, 02:17 PM   #19
charbwoy
Human being with feelings
 
Join Date: Sep 2017
Posts: 8
Default

Came across this thread while searching for a solution to the above, the clipboard is not updating on OSX either (intel) reaper 7.07
charbwoy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.