As far as I know, renaming attachments in Airtable requires re-uploading the attachment with the new name, which in your case would be pulled from the other field.
I don’t know JavaScript so I can’t help you there, but I do all of this myself by using Make, which is a low-code automation & integration tool that doesn’t require any scripting at all.
There can be a bit of a learning curve with Make, which is why I created this basic navigation video for Make, along with providing the link to Make’s free training courses.
There are also many Make experts hanging out there who can answer other Make questions. (Additionally, there are scripting experts hanging out there as well.)
Alternatively, if you have a budget for your project and you’d like to hire an expert Airtable consultant to help you create this, please feel free to contact me through my website: Airtable consulting — ScottWorld