How do I add nodes at equal distance to segments with different lengths?

I need to add nodes to each segment of a shape such that each node is at a specified distance from the previous one.

I am aware of the + key functionality, but it is not useful as it adds too many nodes on short segments and long segments get nodes too far apart from each other.

EDIT:

I want to add nodes via a macro.


Thanks.