How to color all Selected tracks with a Custom Color ?
Hello guys,
I'm building a patch that includes a live.text
message. What I want is for all selected tracks in Ableton Live to be colored with a custom color (in this case, blue) when I trigger a button.
The patch works, but there's one small issue: it only colors one selected track. If I select multiple tracks and press the button (I use a keyboard shortcut), only one track gets colored blue, not all the selected tracks.
How can I modify this patch to color all selected tracks with the custom color? I've tried different approaches, but I couldn't find a solution, it always colors just one selected track.
Here’s the patch for reference:
Here is an image as well

Apparently, selected_track
sadly only returns one track id, as stated in the LOM.
But what you could do is to iterate over all the tracks and check for their is_part_of_selection
property, which returns true
if the track is part of the selection.
While doing so, I would remove that [delay 50] because it could mess with the order of execution.
Thanks @TFL . just a quick question: I'm relatively new to Max , I understand the concept of iterating, I kindff don know how to implement the steps you described in M4L. could you provide some guidance or an example of how to iterate over all tracks and check their is_part_of_selection
property?
Also, regarding the delay, I can remove it for now. It serves another purpose in my patch, but it's not critical to what I'm trying to achieve at the moment.
Here is an example of iteration giving you a list of zeroes and ones representing all tracks selected state:

Then you need to add the few bits to change the color of a track if its is_part_of_selection
property is 1.