Automatically Save Attachments in Mail.app in 10.8 Mountain Lion
Try this.

   using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        -- The folder to save the attachments in (must already exist)


        -- Save in a sub-folder based on the name of the rule in Mail

        set subFolder to name of theRule
        tell application "Finder"
            set attachmentsFolder to ((path to home folder as text) &amp; "Dropbox:Attachments") as text
            if not (exists folder subFolder of folder attachmentsFolder) then
                make new folder at attachmentsFolder with properties {name:subFolder}
            end if
        end tell
        tell application "Mail"

            repeat with eachMessage in theMessages

                set {year:y, month:m, day:d, hours:h, minutes:min} to eachMessage's date sent
                set timeStamp to ("" &amp; y &amp; "-" &amp; my pad(m as integer) &amp; "-" &amp; my pad(d) &amp; "-" &amp; my pad(h) &amp; "-" &amp; my pad(min))

                try
                    -- Save the attachment
                    repeat with theAttachment in eachMessage's mail attachments

                        set originalName to name of theAttachment
                        set savePath to attachmentsFolder &amp; ":" &amp; subFolder &amp; ":" &amp; timeStamp &amp; " " &amp; originalName
                        try
                            save theAttachment in file (savePath)
                        end try
                    end repeat

                    display dialog subFolder
                end try
            end repeat

        end tell
    end perform mail action with messages
end using terms from

-- Adds leading zeros to date components
on pad(n)
    return text -2 thru -1 of ("00" &amp; n)
end pad


I have posted a more general Automatically Save Attachments in Mail.app on my blog