Hi, I've copied the script saved to library location, and jump into mail, setup the rule, etc, all good
I then go to apply the rule on an email to see if it will save the attachment, I also in the rules set up 'Flag' as a colour to see it working.
The flag works, but the attachment doesn't save the attached file to the folder 'Weekly Media'. As you can see by the script below I tried to set the exact path, and no joy here either??
Not sure what I'm missing here.
OS - Mac OS Monterey version 12.4
My script is:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set attachmentsFolder to ((path to home folder as text) & "Weekly Media") as text
(then replaced as 'set attachmentsFolder to "Macintosh HD: Users:myname:Weekly Media" as text) - Tried to remove the space between 'Macintosh HD: and Users', ie 'Macintosh HD:Users....' still no difference??
using terms from application "Mail"
on perform mail action with messages these_messages for rule this_rule
tell application "Mail"
repeat with each_message in these_messages
repeat with theAttachment in each_message's mail attachments
set originalName to name of theAttachment
set savePath to attachmentsFolder & ":" & originalName
try
save theAttachment in savePath
end try
end repeat
end repeat
end tell
end perform mail action with messages
end using terms from