I just needed "17" to work out the midi program name "Drawbar Organ". I found this one that did the job as well as name the track:
Script: spk77_Rename tracks after first program change (for General MIDI).eel
No guru here, but looking at the'Remove MIDI ProgramChange' script, seems you can get the Program value from 2nd item in that msg,..
Code:
in function FilterMIDIData...
...
if msg:len() > 1 then
if msg:byte(1)>>4 == exclude_msg_type then
print(msg:byte(2)) -- Get Program value
--msg = "" --< ignore for this test
end
end
...