(Edited) How to report when a track is renamed in Live?

Mark's icon

renaming a track is not reported by the live.observer.
any tips on a simple way to have this data observed somehow?

broc's icon

Just did a quick test and it works for me as expected.

Max Patch
Copy patch and select New From Clipboard in Max.

Mark's icon

I edited the title because it was wrong. Also the original post is incorrect as i was observing the "tracks" property of the live_set, which reports the id's of the tracks and not their names.
Broc correctly suggested to observe the "name" property of the track, but what i want to do is to receive a notification (just a "bang" would do) when ANY track is renamed, and ONLY then.
I implemented the patcher pasted at the end of this post, it's working, but it has a problem:
When i drag a track to another position it also sends a bang ( two bangs actually). Also it sends a bang when the device containing it is initialised, which i also don't want, but this may be easier to filter out.

If anyone knows how to fix this, or of a better way to achieve this, please let me know.

If anyone wants to check the attached patcher, paste it in a maxforlive device and check the message box connected to the counter. There will be an initial count because of the initialisation bang (which I don't want). If you rename a track and check the counter again, you will notice the count has increased by 1, as I want. Selecting any track does not increase the count, but dragging a track to another position increases the bang count by 2.

Max Patch
Copy patch and select New From Clipboard in Max.

Mark's icon

I managed to "filter out" the unwanted bangs by blocking anything going through when the "name" property is unchanged.
Now it works as desired:
-Bang when any track is renamed
-No bang when any track selected
-No bang when any track dragged
I hope I'm not forgetting to look out for anything else.

In case anyone is curious about the debugging process:
I connected a print object to the left outlet of the second live.observer object and found out that when i would drag a track to another position it would report the "name" value three times, thus the two unwanted bangs.

ps. Helpful tip which I just realised recently:
If you include a print object in the visible part of an M4L device, and double click it, it will open a Max for Live window in which you can view the printed messages. I thought this was only possible in the Max Console Window.

Max Patch
Copy patch and select New From Clipboard in Max.