AppleScript to link back to source email on Mac

I created this applescript to create a link back to the source email. I can then use the apple mail rules to filter known actionable emails to Reminders, and archive them from Apple Mail:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        set ReminderList to "Inbox"
        tell application "Mail"
            repeat with eachMessage in theMessages
                set emailSubject to (subject of eachMessage)
                set recieveDate to (date received of eachMessage)
                set messageid to (message id of eachMessage)
                set urlText to "message://" & "%3c" & messageid & "%3e"
                tell application "Reminders"
                    set whichList to list ReminderList
                    tell whichList
                        make new reminder with properties {name:emailSubject, remind me date:recieveDate, body:urlText}
                    end tell
                end tell
                display notification ("Set reminder for '" & emailSubject & "' due: " & recieveDate)
            end repeat
        end tell
    end perform mail action with messages
end using terms from

Let me know if it worked for you!

Tom Foutz @tom_foutz