How to move Mail.app messages with AppleScript

I have the following AppleScrip to move all Mail messages from one folder to another folder:
on run {input, parameters}
          tell application "Mail"
                    repeat with theMessage in {messages in mailbox "Later" of account "[email protected]"}
                              set theMailbox to mailbox "INBOX" of account "[email protected]"
  move theMessage to theMailbox
                    end repeat
          end tell
          return input
end run
When I run the script, it gives an error message:
Syntax Error. Mail got an error: Can't make {message id xxx} of mailbox "Later" of account "[email protected]" into type scpcifier.
What do I have to change to make this script work?

What you are trying to do, move mail messages older than some time to a different folder, isn't really something that should be down by a rule. Rules are meant to examine messages as they arreive and to prefrom some action based on the mesage.
You would do better to make this a straight AppleScript that you would then run as needed or triggered by something like iCal on a daily basis.

Similar Messages

  • Default to "view as icon" in Mail.app messages (with attachments)

    Hello,
    Other than using Mail Attachments Iconizer (http://lokiware.info/Mail-Attachments-Iconizer), does anyone know of a way to default mail.app to "view as icon" when adding attachments to messages?
    Working in print design, we're always sending PDFs and images and it's a little annoying when you have a large (in dimension, not bit size) attachment and it just takes over your message.
    Thanks,
    Kristin.

    Hello!
    Your English is great.
    There is no default setting for this in Mail but check Mail Attachments Iconizer.

  • MN05 vs SCOT: How to obtain mail status messages (with SP 8)?

    Since we've installed SP 8, we don't receive E-mail status messages anymore.
    In MN05 we always had two communication strategies (defined by "Doc Type/Purch. Org/Vendor") :
    Vendor 1 (ex.: 123hotmail.com)
    Send status/Requested statuts is set to "Return All Statuses"
    send statuts/Status by Mail is set to "All Statuses"
    SCOT is currently set to "not expecting any receipt confirmation or exceptions".
    If we add « hotmail.com » in the domain exception list, our users will receive a status message for everything that is sent to this domain.
    But the goal is to receive status message only for the two vendors defnied in the comm. strategy.
    Any idea?

    I made this test...
    In SCOT,  I added this address as an exception: 123<at>hotmail.com.
    Then in ME9F, I edit my message to the vendor 123<at>hotmail.com... And I receive a receipt confirmation, good.
    Then I edit a message to the vendor 789<at>hotmail.com... And I receive a receipt confirmation too, that's the problem...

  • How can I automatically open Mail.app message attachments after downloading

    The subject says it all, I think.
    My wish #1
    Automatically Opening Mail.app message attachments after downloading
    My Wish #2
    At least having the Finder automatically default to the folder I just downloaded to after completing the download.
    Is this an option in Leopard, at least?

    Very clever. But unfortunately that doesn't seem to work in Tiger.
    Then again, I stil presume that when you do that, a ile is still downloaded and appears somewhere on your hard drive. If you "save as" the file opened by preview, you probably still need to go back to the place where the file was saved and delete it.
    Then again again, if Preview is peeking into a Word or Excel attachment, it may not actually be "downloading it" first?? Strange. If it was a jpg file attachment, on the other hand, it seems more likely that some sort of file would be downloaded to the hard drive as a result of that drag and drop of the paper clip.
    I did find that drag and drop capability interesting, though. Even in Tiger.
    Oh well. I have to start looking at scripts.
    When I downloaded that Automator application that was supposed to "close all open applications", I was surprised that it didn't work. Says it works with TIger. ???
    http://www.apple.com/downloads/macosx/automator/
    Was I supposed to import it into Automator as an "action" and save it as an Automator application and then open Automator and click "run" for that action each time I wanted to use it? Seams a bit cumbersome.

  • HT4527 How can move the apps and playlists on my iPad to my Mac? Whenever I attempt to sync, I get a message stating that all apps and music on my iPad will be replaced by content from my Mac and there are no content. Thanks.

    How can move the apps and playlists on my iPad to my Mac? Whenever I attempt to sync, I get a message stating that all apps and music on my iPad will be replaced by content from my Mac and there are no content. Thanks.

    the apps will not be deleted if the itunes is authorised for the apple id from which you downloaded the apps.
    for the songs if you have downloaded it from a store other than itunes an app "TuneAid" will help you. download the full version then you can copy all the songs on the ipad to ur itunes library

  • How to move contacts and messages from Samsung Galaxy S3 to iPhone5?

    How to move contacts and messages from Samsung Galaxy S3 to iPhone5?

    As long as you had the Android data synced with your Google account, they should be there when you sync it on your new phone. That is by far the easiest way.
    I think there is also an import/export option when you hit the menu button in the contacts app. and you could export them to SD card and import them on the new phone using the same SD card.
    Or you can use Mobile Transfer to transfer data between Android smartphone. It is really simple, follow this guide to move contacts from Samsung S3 to iPhone 5.

  • How to configure Mail app on mountain lion to not download all my emails in hotmail server. I need only just 1-2 weeks

    How to configure Mail app on mountain lion to not download all my emails in hotmail server. I need only just 1-2 weeks

    Try going to the web based site and see if you can set up a temporary folder there. Move anything you don't want to download to that folder.

  • How to move an apps from Mac to iPhone?

    How to move an apps from Mac to iPhone? My 4s after upgraded iOS 6 is can't connect to wifi and missing all contact number. Worst phone ever!!!

    Selected under the Apps tab for the iPhone sync preferences with iTunes followed by a sync.

  • HT1766 i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5 but the apps do not appear to have come across, have I done something wrong?  Please can someone tell me how to move my apps

    i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5, but the apps do not appear to have come across.  Have I done something wrong?  Please can someone tell me how to move my apps across?

    After you Restore from backup, sync the iPhone.

  • How to associate a test message with a change document

    I am using solution manager 7.01.
    accessing my change documents through the workcenter I need to create a new test message - so I use the Create transaction button on the button bar, Service Process, Test Message
    Then I am in the create test message screen.  However from here I cannot see how to associate my test message with either the change document that I was processing or to the maintenance cycle.
    Ideally I want to link the test message to the change document however at least to the maintenance cycle.
    How do I do this?
    Am I creating the test message in an incorrect way?
    regards
    Marina

    Anyone?  Does no one use Test Messages?

  • How to send a SOAP message with attachments

    How to send a SOAP message with attachments thru webservice using axis-1_3 can any one sujjest.............................

    Please refer
    http://www.javaworld.com/javaworld/jw-09-2003/jw-0912-webservices.html
    http://xml.sys-con.com/read/40315.htm

  • How can I open a document with applescript without the doc. window opening.

    How can I open a document with applescript without opening the document window and speak the text of the document?  I can get it to open the file but the doc window always opens up. 

    try
              set pathToMyFolderOnDesktop to ("Macintosh HD:Users:jodyconnor:Desktop:") & "Dsource:" as alias
              set rnd to (random number from 1 to 6)
              set rndFileName to (rnd as text) & ".scpt"
              set FullPath to pathToMyFolderOnDesktop & rndFileName as text
              set myScript to load script (FullPath as alias)
      run script myScript
    on error the error_message number the error_number
              display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
              return
    end try
    This code answered my question:  Hats off to Digimonk from stackoverflow and Darrick Herewe from stackoverflow.

  • Indesign : how to move a rectangle object with his content ?

    hi
    i develop an indesign extension with flash builder and cs extension builder 2.
    when I move a rectangle object containing an image with the geometricBounds property the image does not move and is not visible anymore ...
    how to move a rectangle object with his content ?
    thanks
    Simon

    Use rectangle.move()

  • HT1688 how do I transfer apps, messaging, and data from my old iphone to my new iphone

    how do I transfer apps, messaging, and data from my old iphone to my new iphone

    firstly sync your old iphone,then connect your new iphone and sync from backup.

  • How long does Mail save messages?

    How long does Mail save messages? What happens to them at the end of that period?

    Depends. If you have a POP account and download your messages, then they are on your hard drive until you delete them. However, unless you enable the option to save email messages on the server once downloaded the message are deleted from the server immediately. Your email ISP may retain backups for some period of time, but you would need to ask them about it.
    If you have and IMAP account your messages are saved on the server unless you delete them. They will be retained on the server indefinitely.

Maybe you are looking for