sricpt: mail attachment to downloads folder - adjustment for Catalina?

The fact that you do not understand how it works does not mean that it does not work… The Apply action in the application settings means the persistent state of this action in the future too.

In your case, you have created only one condition - the receipt of a mail from yourself. Since you already sent yourself a mail (for the test), and you don’t send anything to yourself anymore, naturally, nothing else comes from you.

Now, you have to create some other condition, for example, the receipt of a email from some other sender. Which sends you mails, of course. And wait until he sends you a mail with an attachments inside.

But, I am not a primary school teacher. There are Mail.app guides to learn mail rules. I am always happy to help in Mail.app’s scripting problems that are not described in books.

I missed the fact that compilation had modifier the passed script.
I edited it, saved it in “SSD 1000:Users**********:Library:Application Scripts:com.apple.mail:” and tested it so I know that it works.

using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		set downloadsHFSpath to my setPath()
		tell application "Mail"
			repeat with oneMessage in theMessages
				repeat with oneAttachment in (mail attachments of oneMessage)
					save oneAttachment in (downloadsHFSpath & name of oneAttachment)
				end repeat
			end repeat
		end tell
	end perform mail action with messages
end using terms from
on setPath()
	return (path to downloads folder as string)
end setPath

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 12 mai 2020 22:59:17