I got it. I needed a for loop to go through the attachment names:
let newAttachments =
for (let attachment of attachmentField) {
let newTitle = `${title}-${authors}-${attachment.filename}`
//push each new attachment to...
Thank you. I am beginning to understand the syntax.
So if I have varying number of attachments, usually between 1 and 4 how would I do this? I am not sure where a loop would be required. This code will delete any attachments beyond 1.
Kind regards,
A...
I have a similar issue, but instead of the new title completely replacing the old title, I need to prepend it to the name of the old title.
So I changed:
let newTitle = `${title} by ${authors} - MySiteName`
to
let newTitle = `${title}-${authors}-$...