I’ve got a routine that saves mail & attachments as rtfd docs.
Unfortunately they have to be saved on a windows server, and long attachment names are proving to be a problem (interestingly, the server sees rtfd’s as a folder)
Does anyone know a way to reset the names of mail attachments please.
tell application "Mail" activate set temp to every message of mailbox "tester" repeat with A in temp open A --set AA to name of attachment 1 of document 1 repeat with AA in the mail attachments of A set n to name of AA set newname to n if (count of n) > 30 then set TheSuffix to "" try set TheSuffix to the name extension of n end try if (count of TheSuffix) > 0 then set TheSuffix to "." & TheSuffix set newname to (characters 1 thru (30 - (count of TheSuffix)) of n) & TheSuffix end if set the name of AA to newname -- this doesn't work end repeat end repeat end tell