Old 05-21-2020, 07:30 AM   #1
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,056
Default How To - Select only tracks with Tags in name

Hi Everyone

i use scripts (or cycle action) to add [TAGS] to my tracks. It allow me tu use auto-color, auto icon based on those tags and it allow me to hide/show tracks woth those tracks

Right now, I'm using cycle action to hide/show tracks based on console action like S *[TAGs]* . WOrking great but it's pretty long to create all the cycle action

I would like to create script that allow me to select track containing TAGS

I know that me2beats create script that allows to select track when the name match but I would like to make the selection just on the fraction on the name


Example :

full track names:

Kick In [KIK] [DRM]
Kick Out [KIK] [DRM]
Snare top [SNR] [DRM]
Snare bottom [SNR] [DRM]


I need a way to select tracks containing [KIK]

is is possible via reascript?

Code:
for i = 0, tracks-1 do
  local tr = r.GetTrack(0, i)
  local _, tr_name = r.GetSetMediaTrackInfo_String(tr, 'P_NAME', '', 0)
  if tr_name  == name then r.SetTrackSelected(tr, 1) end
end
with this code, it only works on full name MATCH

Thanks in advance
Reno.thestraws is online now   Reply With Quote
Old 05-21-2020, 07:35 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,145
Default

"if tr_name:find(name, 1, true) then ..." for a partial match.
cfillion is offline   Reply With Quote
Old 05-21-2020, 07:43 AM   #3
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,056
Default

Thanks a bunch!

-----------------------

Tiens salut cfillion

tant que je te croise, est-ce que tu as jeté un oeil à ceci?

https://forum.cockos.com/showthread.php?t=236564
Reno.thestraws is online now   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 05:14 AM.


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