WORKFLOW: move Mesh Vertices/edges on an average line?

I think I am missing out something simple:

I have a mesh (a terrain)
All the selected edges, from top View, are colinear.

All the Z values of vertices A, b, c, d, e, f, g, h, Z, differ.

Is there a command (not in grasshopper), or a convenient workflow, that: keeping point A and Z where they are, will just move up/down all the other vertices (so that they will fall on an average—in the picture the dashed—line)?

This excellent script might do just the job. It works on CVs of surfaces. Maybe it also works on Vertices.

Did you try ALIGN using ToLine options?

That script only works with surfaces, unfortunately
Anyway, thank you for the script!

Simply, the solution was to use Align with ToLine. thank you skysurfer!
However I have a problem, I got it to work only once and then this command does not work anymore, I closed and restarted Rhino, same, I can’t get it to work anymore, am I missing something simple?
I cannot post the file for NDA, but I grabbed a video

Hi @bie
You need to turn on the control points (F10) first. What you are doing is selecting the vertices, and the Align command doesn’t work on those (don’t ask me why - it should, I think!).
HTH, Jakob