Spline Material ID


I need a script to assign predefined id to selected segments of a spline.
Then i want just assign it to a keyboard combination to set IDs on the fly.

This worked for edit poly:

MacroScript mtl_id_1 category:"ID" buttonText:"mtl id 1"
tooltip:"mtl id 1"
$.modifiers[#Edit_Poly].SetOperation #SetMaterial
$.modifiers[#Edit_Poly].materialIDToSet = 0
$.modifiers[#Edit_Poly].Commit ()

I need this, but for spline.
Please, Help a noob out.

PS. There is very little resources about spline editing. Maxscript listener does not hear spline editing...