Change ID names of multiple widgets

Hello community!

Is there a way to select multiple items in the Project Tree and then change a portion of their ID names by only adding a prefix and keeping the remaining part of the ID name the same?

For example, the selected items all have the current prefix "OM1_" (OM1_fader, OM1_switch). I would like to duplicate those items and change only the prefix to "OM2_ leaving the remaining part of the ID name as it is.

Right now when I try to make the ID change, it makes all the ID names the same. So, I need to select each item individually to make the change to only the prefix.

Any ideas??

Hi
not sure it's possible inside OSC
But when I need to do multiple id modification, I'm using an external code editor like sublime and use the search replace function to do the trick.
hope it helps

1 Like

@zoltan's solution seems the best available so far.

Thank you both for your help!
I didn't consider using sublime, that's a great suggestion, I'll give it a try

I, too, make these sorts of changes to the JSON using an IDE or editor I know well (in my case, WebStorm or vi).

Hi there,

Another idea : create a variable NAME_01 to be used to name your different widget id.

image

and if you want to change the id for many buttons, just change the value of the variable NAME_01

naming_things.json (4.1 KB)

Cheers

Thanks everyone for your replies!
You've presented a few options here I'll explore in more detail to see if they are easier/faster than simply making the changes one-at-a-time in the Project Tree.

Appreciate all the help!

in your case the best solution as said by many is to save your session json file then open it with an editor (sublime, vi, nano, notepad, vscode) to search your pattern and replace by the new string.
Then save it and load it into o-s-c !

My "solution" is more for your next big project at the begining but keep in mind that you can't use duplicate id + 1 in that case, it won't work (dommage d'ailleurs @jean-emmanuel :slight_smile: )

Cheers