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
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