Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wesleyh

macrumors 6502
Original poster
Mar 23, 2007
432
0
It works only when you right click on the mail message and choose "run rules", but not on incoming messages (without interaction).

The first dialog is shown both when incoming or running manually, but the second dialog (with the id) is only shown when running manually. Nothing is shown in console.log

Any ideas?

Code:
using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"
            repeat with theMessage in theMessages
                display dialog "inside"

                set theId to id of theMessage

                display dialog "the id is " & theId

            end repeat
        end tell
    end perform mail action with messages
end using terms from
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.