Previous 1 2 3 4 Next 52 Replies Latest reply: Feb 3, 2014 6:09 AM by LogicProLetsGo Go to original post
  • Niko Nyman Level 2 Level 2 (270 points)

    jbublik, are you sure you're running Mountain Lion / OS X 10.8?

     

    The on perform_mail_action(ruleData) syntax in your first example is deprecated in 10.8 Mail and does nothing; in effect the perform_mail_action handler is never executed.

     

    Your second example uses the current on perform mail action with messages syntax, but fails on 10.8 just the way I described here: https://discussions.apple.com/message/19501549#19501549

  • Niko Nyman Level 2 Level 2 (270 points)

    jbublik, Are you getting mail from IMAP or POP account? Applescript Mail rules on IMAP accounts generally seem to work (but only with the new syntax), but Applescript rules on POP accounts are failing.

  • jbublik Level 1 Level 1 (0 points)

    all three my accounts are IMAP. I am not sure why it would make a difference though? I guess I never thought about it.

    Jan

  • GeekNeck Level 1 Level 1 (0 points)

    Works like a charm, Screaming.Pict.  Thank you!

  • danyps Level 1 Level 1 (0 points)

    Hi,

     

    I'm new to applescript and I tried to get this script working on my mbp but it doesnt. I'm curently running OS X 10.9 maverick and Mail.app 7.1

     

    Is there anyone out there that can help me.

     

    Thanks.

  • rich graham1 Level 1 Level 1 (0 points)

    Here's a script I found that works under Mavericks - need to work on it to make it work as a rule.

     

    tell application "Mail"

              set theMessages to selection

              set theMessage to item 1 of theMessages

              set theAttachments to every mail attachment of theMessage

              repeat with a from 1 to length of theAttachments

                        set theAttachment to item a of theAttachments

                        set theOutputFolder to (choose folder) as string

                        try

                                  set theAttachmentName to name of theAttachment

                                  set theSavePath to theOutputFolder & theAttachmentName

      save theAttachment in theSavePath

                        end try

              end repeat

    end tell

     

     

    tell application "Finder"

      reveal theSavePath

              set bounds of Finder window 1 to {10, 50, 1000, 500}

      activate

    end tell


  • danyps Level 1 Level 1 (0 points)

    I used this script in the mail.app as a rule and it doesn’t work, theres no error but there is no activity…

    Is there some error in my script?

     

    Thanks.

     

     

    tell application "Mail"

     

              set theMessages to selection

              set theMessage to item 1 of theMessages

              set theAttachments to every mail attachment of theMessage

              repeat with a from 1 to length of theAttachments

                        set theAttachment to item a of theAttachments

                        set theOutputFolder to (attachments) as string

                        try

                                  set theAttachmentName to name of theAttachment

                                  set theSavePath to theOutputFolder & theAttachmentName

      save theAttachment in theSavePath

                        end try

              end repeat

    end tell

     

     

     

     

    tell application "Finder"

      reveal theSavePath

              set bounds of Finder window 1 to {10, 50, 1000, 500}

      activate

    end tell


  • LogicProLetsGo Level 1 Level 1 (0 points)

    That won't work as a rule because you are using the selection object and I think you intend to have the selection selected automatically. You would need to change things a bit.

     

    I am not sure how to pass the incoming mail directly to the script, but that is what you need to do as rich graham1 suggested.

Previous 1 2 3 4 Next