Merry Christmas to all of you.
For testing I used :
set attachmentsFolder to "Volumes:folder1:folder2:" set attachmentsFolder to (path to documents folder as text) & "4attachments:" --set attachmentsFolder to (path to desktop as text) & "4attachments:" --return attachmentsFolder tell application "System Events" exists folder attachmentsFolder end tell tell application "Mail" set theMessages to the selection set selectedMessages to theMessages --try repeat with theMessage in selectedMessages
repeat with theAttachment in theMessage's mail attachments try set originalName to name of theAttachment set savePath to attachmentsFolder & originalName tell me to set savePath to POSIX file (POSIX path of savePath) save theAttachment in (savePath) log "saved" end try end repeat
end repeat --end try end tell
It behaved flawlessly under 10.12.1 But under 10.12.2, every attempt to save an attachment issued :
--> error "Pour afficher ou modifier vos autorisations, sélectionnez l’élément dans le Finder, puis choisissez Fichier > Lire les informations." number -10000
On both systems, the permissions for 4attachments on the desktop are: me read/write admin read only everyone read only for 4attachments in Documents folder they were: me read/write admin read/write everyone read only After the tests I restored admin to read only.
It's the third oddity which I face when using AppleScript under 10.12.2 (as bad as 10.12.3)
Report # 29683268, Under 10.12.2 (and 10.12.3) AppleScript keystroke command fails
Report #29753839 "under 10.12.2 (and 10.12.3) exporting iWork doc thru AppleScript is killed"
Of course it would be useful to file reports of your own.
I will file one for the Mail problem.
Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) dimanche 25 décembre 2016 11:42:32
|