AppleScript to delete attachments in mail?

I have a smart mailbox that shows all my emails that have a certain age and attachments.

Now, I would like to have an AppleScript that would choose the first (or last) email in the smart mailbox.

and remove all attachments, that is, the fact of the menu item Mail-> Message-> remove attachments.

And who would do for all the mails in the box smart mailbox.

Why do they want an AppleScript for this?

Because I can't select all mails and go to mail-> Message-> delete attachments,

because it is always emails asking me if I want to remove from my emails.

(I have no idea why it does, I suspect a bug).

When I select a few 10s of mails, it works.

Unfortunately, I have 3000 mails in this smart mailbox, so doing it in batches of 30 emails is a bit tedious.

If someone could point me to an AppleScript not what I want to do, or makes something similar,

I would be very grateful.

Also, if someone could give me some advice what Applescript commands I need, then I might be able

to combine a script by myself (I know a bit of Apple script, but I'm much more common in other programming languages).

Thank you very much in advance for all sorts of tips and tricks.

Best regards

Gabriel.

Unfortunately, this sounds more complicated that you might hope / expect.

There is little AppleScript support for the management of attachments or mailboxes in Mail.app smart mailboxes. The only thing you can do with attachments is save, which is the opposite of what you are trying to do.

The dictionary implies , you should be able to do something like:

say application "Mail".

game of theMessages (each message in the mailbox "whatever" from account "iCloud")

Repeat with each_message in theMessages

delete (get each attachment of each_message)

end Repeat

end say


but it does not inexplicable way.

Because you are pretty much limited to two user interface actions (to simulate what you do manually when you select the menu item), or analysis of e-mail attachment to find the document on the disk and remove from under Mail.app (although I don't know what this can have implications)

Tags: Mac OS & System Software

Similar Questions

  • Delete attachments deletes any E-mail

    MacBook Pro OSX 10.11.3 running.

    This used to work, but did not for the latest two OS major updates. Now, when I try to use remove attachments to mail this removes the entire email. And he disappeared without a trace, too. The email won't even be in the trash folder. It vaporizes completely.

    How can I delete attachments in emails? The command does not work, so there's a manual work-around I can use?

    Thank you.

    Mail 7.0 (1822) deletes an e-mail when you go to Message > remove attachments

  • Cannot remove attachments of mail 9.2

    In previous versions, I could remove all the attachments of the emails I was responding too.

    I would like to respond and then click on 'delete attachments' and all attachments have been deleted.

    Now on the latest version of Mail 9.2, 'delete attachments' is grayed out. So when I reply to an email, I need to scroll down to attachments and delete them manually.

    In the Edit > attachments uncheck "include Original spare part in response."

  • Deleting an e-mail in the Outbox on iphone7?

    How can I delete an e-mail that rotates continuously from the Outbox of my iphone7? I tried to turn on airplane Mode and editing, but this is not the emails from spin or activate the button change.

    Have you ever tried to force reboot the phone by holding down the button sleep and home for 10 seconds, until the Apple logo comes back again? You won't lose data, but it can cure a few glitches.

  • Using apple mail, I can't manually delete an e-mail w/out move to the trash. Nothing I've tried has had no effect...

    Using apple mail, I can't delete an e-mail with or without manually move it to the trash. Nothing I've tried has had no effect... help!

    You tell us what version of Mail or OS X

    Address postal (Yosemite): delete messages

    Try Mail (El Capitan): rebuild the mailbox

  • Can you modify or delete an e-mail address of icloud

    Hey, I'm new to the community of support, but a user of apple of long date. I'm trying to find out if there is a way to change/delete my e-mail @icloud address of my apple ID.

    I created my e-mail address of icloud 3 years ago, but now want to remove. I have read most of the posts on this and know that I can add an alias, but is there a way to remove the one I currently have (say, it's *) of my apple ID? (I know how to remove it from my computer, iPad, iPhone, etc., which is not my question)

    From what I could tell, there's a way. However, I wanted to make sure and just ask my question because I couldn't find all the messages that were exactly the same.

    < personal information deleted by host >

    You are right. There is no way to remove your iCloud of your Apple ID email address Generally cannot "delete" any Apple ID.

    See you soon,.

    GB

  • When send email with attachments e-mail sent with attachments in double and that duplicate emails

    When you send e-mail with attachments, e-mail messages appear in the folder sent twice, sometimes four times and attachments are duplicated and even occasionally contains an attachment, I did not add. Also message saying sent copy file failed, then copies appear in the sent folder. Also get frequent message of savings to the project folder failed.
    How can I fix these errors? Thunderbird running 38.20.0
    Thanks to all for the show time and consideration for answering my questions.
    Midnightsunman

    1. If you use Outlook.com or disable Gmail registration of mail sent in your account settings. Both the add when the mail goes through their SMTP servers.

    2. compact your projects and files sent. The setting is on the shortcut menu.

    3. create and exemption from any real-time analysis of your Thunderbird profiles by your anti virus file.

  • Stop the iPhone to delete marked e-mail

    Over time, my iPhone will automatically 6s running OS 9.3.2 delete marked e-mail.  How to prevent this?

    You can change your download/retention of mail settings?

    What type of e-mail account is it?

    TT2

  • Cannot delete an e-mail, delete account tab is not highlighted?

    Try to delete an e-mail, but in the idenities tab the tab account delete is not high on so I can not delete the account? I have a screen shot is 220 KB it will not download.

    You cannot delete the default account. You want to remove is marked by default? If so change the default and try again.

  • When I reset Firefox it deleted my e-mail account Outlook on my iMac

    When I reset Firefox it deleted my e-mail account Outlook on my iMac computer. He also moved my AccountEdge accounting file in the data file of old Firefox on my desktop as well as all backups. It is also Microsoft user data files, and some Word documents in this file. I hope you can help because I don't know how to put these files back where they belong.

    Back up and restore the information contained in the profiles of Firefox , it would help for files associated with Firefox.

    However in regards to the Outlook e-mail, you can restore with these instructions http://email.about.com/od/outlooktips.../Restore_Outlook_Mail_Contacts_and_Other_Data_from_a_Backup.htm

    I'm not quite familiar with the storage of outlook files in Firefox.

  • I deleted two e-mail accounts in my iMac (El Capitan). I have reinstalled the first without problem. When I tried the second, I got an error message that the account already exists. Any suggestions?

    I deleted two e-mail accounts in mail on my iMac (El Capitan). I have reinstalled the first without problem. When I tried the second, I got an error message that the account already exists. Any suggestions?

    First of all, make sure that you don't have two accounts with the same address. What happens if one of them is an iCloud account.

    From the Mail menu bar, you select

    ▹ Connection Doctor window

    In the window that opens, look for an SMTP (outgoing mail) account with a name that corresponds to the account that you are trying to add. Double-click it. Another window opens, displaying the list of all outgoing mail accounts. Click the sign button less to remove the corresponding one, and then click OK.

    Try to add the email account again. If you still can not, log off or restart the computer, and then open the preferences window accounts Internet and check if the account is displayed.

  • Cannot delete messages in Mail

    Why I get this message when you try to delete and send mail: cannot open the file '163352.emlx' because there is no file.

    I had this problem before the last update, but now it started again.  I have about 5 messages that I can't delete because I get the above error message when I try to delete them.  Any idea what's going on?

    Please backup all data, and then recreate the mailbox.

  • Why can I no longer drag and drop attachments in mail in the finder toolbar shortcut icons?

    Why, since I've upgraded to El Capitan, can I no longer drag and drop attachments of mail of the finder to my mail icon shortcut in the finder toolbar? When I do, I get a symbol indicating I can't drop the file there. It's a convenient shortcut for me.

    How did you get the icon in the tool bar of the Finder window? Using a type of extension?

  • Windows Mail deletes any e-mail as soon as it is read and closed

    A few days ago Windows Mail suddenly started to delete all e-mails as soon as I read and closed.  He has also instantly deleted previously read all mails.  These emails are not visible in the elements deleted - they disappeared completely.

    This problem is only happening in my account (I am the computer administrator) - user account of my wife is not affected.  I can't find any setting that could be the cause.

    Can anyone help?

    A final servile apology - I found the cause of the problem.  In the view-> current view option, the setting had somehow changed to show all Messages to hide Read Messages.  When I reset, all of my emails 'disappeared' reappeared.  I don't know how it happened, because it is not an option that I knowingly consulted before (I just found today).

    Thank you for your efforts - I regret that they were not necessary.

    Ian

  • I can't delete an e-mail in the Outbox, I right click and you press DELETE nothing helps

    I can't delete an e-mail in the Outbox, I right click and you press DELETE nothing helps

    What should I do?

    If she is trying to send, you must check first to work offline and then it should delete.

Maybe you are looking for

  • I forgot the password on your old phone. What are my options?

    try to put an old phone (5) back into service and have managed to forget the access code.  What are my options.  AM not locked yet, but get closer.  just updated to 9.2 and it will not be installed until I give him the right password.

  • DVD Bluray.

    Recently, I replaced my Pavillion G7 1261nr with a 2269wm of Pavillion G7. I want to know if I can take the Bluray of the 1261nr one could in the 2269wm?  I coulnot find an affordable replacement with bluray and I use my laptop for tat frequently. Th

  • Think of a T410 laptop, is it useful?

    Hey there. I recently bought a laptop T61 used; GPU from Intel, Intel T7500 2.2 GHz, 4 GB of ram and a 14 "4:3 1400 x 1050 screen. I added a 128 GB SSD and configure the BIOS middletom SATA2 support. I also have Win8.1 64 bit that works very well wai

  • Where in the Gauteng JHB is for Acer laptop repair center

    Need a new screen for my laptop, 10 inch

  • When using Media Player Classic, can not find DVD

    When I try to play a dvd with media player classic, I got an error message saying cannot find DVD