How to rename a file with a name in the filename

I get downloads of student assignments. I want to rename each file to shorten it to the last name of the student and the assignment name. I think it is an Applescript to make it work. I tried to use others as examples. NO LUCK.
The name of the files are
Letter to the First Year STILL Due 5 28_noaveyar.lee_attempt_2020-05-17-17-18-09_Letter to Year 1 students
they are docx or pdf files.
I want to rename to
LAST NAME Letter.extension
Can this work? THANKS
The name of the files are
Letter to the First Year STILL Due 5 28_noaveyar.lee_attempt_2020-05-17-17-18-09_Letter to Year 1 students
they are docx or pdf files.
I want to rename to
LAST NAME Letter.extension
Can this work? THANKS