From another thread (which became overrun):
This will actually delete muted MIDI events and then glue everything on the track, (you can change that behaviour). This is not ideal, as what we really need to do is mute the notes that are in the part, not delete the part.
However with audio it will glue all and keep the muted audio.
Simply copy this and assign to key command if required.
GlueAllDelMuted.xml (5.6 KB)