Say you have a table with 10 000 attachments and multiple other fields related to this attachment.
You want to rename each attachment to a combination of the records other columns. To do this:
1. Create a formula column with the name you want for the attachment
2. Use the script below as an extension
3. Run it, it will go through all rows and give the name you have specified in a column to each attachment