Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 01-17-2019, 09:13 AM   #1
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 471
Default Rename selected items/takes using source filenames?

Every time I render items, I need to rename the rendered items to the actual filenames. Otherwise, they all have the same name taken from the track and region they are in, despite the fact that the file naming scheme uses the $region_$namecount wildcards, and the resulting filenames come out just fine with incremental numbering per region.

Is there some way to get all of the rendered items/takes to show the actual name of the wav file instead of the same take name as every other item in that region? Same goes for glued or frozen items too.

If there's not a simple setting change to display them this way, then is there a script to rename all selected items/takes so their names match their filenames?

Last edited by earhax; 01-17-2019 at 09:15 AM. Reason: adding "selected" to title for clarification
earhax is offline   Reply With Quote
Old 01-18-2019, 10:17 AM   #2
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,012
Default

if you have SWS extensions installed, you should try the SWS Label Processor.

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 01-18-2019, 11:41 AM   #3
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 471
Default

Quote:
Originally Posted by SonicAxiom View Post
if you have SWS extensions installed, you should try the SWS Label Processor.

.
Oh heck yes. Using that with /s renames every item in the session (if I have them all selected) with the filename almost instantly. AWESOME!

Now I am just wondering: could I script this into an action somehow so that I don't even need to use the prompt, and it'll just automatically rename everything using each item(s)/take(s) filename in a single keystroke? If so, and you have an idea how, please let me know. Thanks!
earhax is offline   Reply With Quote
Old 11-05-2021, 01:58 PM   #4
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,416
Default

I this issue... but since there was no solution, I made my own:
Code:
-- MF_Rename active takes to source name
-- M Fabian, v0.1, November 2021
local rpr = reaper

-- Prevent UI refresh
-- For each selected item
-- -- Get the active take
-- -- Get the source name (strip the path)
-- -- Rename take to source name
-- Enable UI refresh, Update arrange view

local function SplitFileName(fname)
  -- Returns the Path, Filename, and Extension as 3 values
  return string.match(fname, "(.-)([^\\]-([^\\%.]+))$") -- Windows only!
end

local function RenameActiveTake(item)

    local take = rpr.GetActiveTake(item)
    local source = rpr.GetMediaItemTake_Source(take)
    local filename = rpr.GetMediaSourceFileName(source)
    local path, srcname, ext = SplitFileName(filename)
    rpr.GetSetMediaItemTakeInfo_String(take, "P_NAME", srcname, true)

end

local num_sel_items = rpr.CountSelectedMediaItems(0)
if num_sel_items == 0 then return end

rpr.PreventUIRefresh(1)
for sel_item = 0, num_sel_items-1 do
    local MediaItem item = rpr.GetSelectedMediaItem(0, sel_item)
    RenameActiveTake(item)
end
rpr.PreventUIRefresh(-1)
rpr.UpdateArrange()
I use this together with Xenakios/SWS: Choose new source file for selected takes... in an action to choose a new file for a take and have the take renamed to the source file name.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian 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 04:40 AM.


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