Saving a Mail Attachment OS X LION


I used to use the following script to have mail automatically save attachments to a folder when they arrived in mail. Since updating to Lion the script no longer works and I was wondering if anyone has a work around or if it is likely that Apple will fix this? We have just bought a new Mac Mini running O SX Lion and we are now thinking we need to sell it and buy an old one!

(*Mail attachment save script by Luke Jaeger

This script will mine a list of Mail messages for attachments and save them to a destination you choose.

using terms from application “Mail” -----bij mail rule aanzetten
on perform mail action with messages theMessages for rule theRule -----bij mail rule aanzetten

   --set theOutputFolder to (here's where you tell it the main folder to save in)
   tell application "Finder"
       set theOutputFolder to folder "disk:folder"
   end tell
   tell application "Mail"
       --comment the following line when running this script as a rule function - uncomment it for testing
       --set theMessages to selection --------bij testen aanzetten
       repeat with theMessage in theMessages
           --does the message have attachments? if not, then skip it
           if (every mail attachment of theMessage) ≠ {} then
               --save the attachment to the subfolder
               set theAttachments to (every mail attachment of theMessage)
               repeat with theAttachment in theAttachments
                   set thePath to (theOutputFolder as string) & (name of theAttachment)
                   --if same named file already exists in subfolder, skip it    
                   if not (exists (alias thePath of application "Finder")) then
                       save theAttachment in thePath
                   end if
               end repeat
               set read status of theMessage to true
           end if
       end repeat
   end tell

end perform mail action with messages
end using terms from


in Lion the save command of is broken

Use GUI scripting.

It seems that 10.7.2 has finally solved it.
Anyone to confirm this ?