Automation to move task(s) to the top or bottom

Does anyone have a script/automation plugin that can take a set of (zero or more) tasks and move them to the top or bottom of the current list in the current perspective?

By “list” I mean anything with a “v” triangle next to it: a group or a project or a list of tags, whatever the list is.

In essence, the same behavior as the actions in this submenu but top or bottom:
image

This has come up in the forums for the past 10+ years and it would be super useful.