There is a builtin script "Delete Message Immediately", doesn't it do as
you want?
--
Andy Fragen
On Fri, Jan 2, 2004, Tom Dillon said:
>
>How do I delete a single message via AppleScript? I've looked at the
>script from Wayne Brissette's site for deleting a list of messages
>thinking it would be easy to figure out how to delete one from within a
>filter, but my brain just can't figure out how to assign a single message
>for deletion.
>
>tell application "PowerMail"
> display dialog "The selected messages will be deleted immediately."
> buttons {"Cancel", "Delete"} default button "Delete"
> set btn to button returned of result
> if btn is "Delete" then
> set theMessages to current messages
> repeat with msg in theMessages
> delete msg
> end repeat
> end if
>end tell
>
>
>Works great, but I want to delete a single message from a filter. For
>instance, if the message subject is "Huge, Throbbing Mortgage", then
>delete the message immediately (not into trash). So, how do I assign the
>current message that the filter is looking at to the variable 'msg' so I
>can pass it to 'Delete'?
>
>I guess I could just move the message to the trash and have a script
>empty the trash, but...
>
>Thanks
>
> ------------------------------------------------------------------
> Tom Dillon 12081 W. Alameda Parkway
> DataCraft #506
> [EMAIL PROTECTED] Lakewood, CO 80228
> http://www.DataCraft-Inc.com/ 720/962-4880
> ------------------------------------------------------------------
> Gosh it would be awful pleasin', to reason out the reason,
> for things I can't explain. --- Scarecrow
> ------------------------------------------------------------------
>
>
>