AppleScript to copy email attachment failing - HELP
I found what appears to be an outdated solution to this question here.
I am having no luck with it on Catalina. At first I thought the issue was new Apple security protocols, but I see nothing in that panel suggesting that's the issue. I am unsure how to log this for clues, since it's being run from Apple Mail and not Script Editor. ( that might reveal the cause of the failure)
using terms from application "Mail"
on perform mail action with messages theMessages
set attachmentsFolder to "Volumes:Catalina:Users:john:Documents:Attachments:" as rich text
--remove the angle brackets, but keep the colons, including the last one
tell application "Mail"
set selectedMessages to theMessages
try
repeat with theMessage in selectedMessages
repeat with theAttachment in theMessage's mail attachments
set originalName to name of theAttachment
set savePath to attachmentsFolder & originalName
save theAttachment in file savePath
end repeat
end repeat
end try
end tell
end perform mail action with messages
end using terms from
My Mail rule is setup correctly to isolate the correct email. I tested it by changing the Action from "Run AppleScript" to "Set Color of background Green"
I thought that permissions might be an issue so I set them too:
01/05/22_19:22:31 /Users/john
0-zsh% chmod 755 /Users/john/AppleScripts/Wildcat_Weekly.scpt
01/05/22_19:22:44 /Users/john
0-zsh% ls -la /Users/john/AppleScripts/Wildcat_Weekly.scpt
-rwxr-xr-x@ 1 john staff 3478 Jan 5 19:19 /Users/john/AppleScripts/Wildcat_Weekly.scpt
Regarding the Security & Privacy pane. I believe there is supposed to be a warning dialog box when an application or process is trying to gain access - that is not appearing.
In the Menu bar a progress cog does pop up briefly when the action is run.
iMac 27″, macOS 10.15