Auto saving email attachments using date email received as the name of the attachment file

I would like to be able to batch save hundreds of email attachments in my inbox to a specified folder and use the date and time email was received as the name of the file.  i found sample script that would give it timestamp but would prefer date and time of receipt.  any help would be greatly appreciated.
thanks.

I found the below script online but it does not seem to be naming correctly.  it appears that the month always defaults to 12.  perhaps somehow could suggest a fix?
set theAttachmentPath to (path to desktop) as text
tell application "Mail"
          set a to selection
end tell
repeat with s in a
          tell application "Mail"
                    set current_date to date received of s
                    set CurrentSender to sender of s
          end tell
          set current_date to AppleScriptDateToString(current_date)
          tell application "Mail" to set Attached to mail attachments of s
          repeat with ThisAttach in Attached
                    tell application "Mail" to set FileName to name of ThisAttach
                    if FileName ends with ".pdf" then
                              set FileName to current_date & " from " & CurrentSender & ".pdf" as text
                              set FileName to checknamewith_pdfsuffix(FileName, theAttachmentPath, false)
                              tell application "Mail" to save ThisAttach in theAttachmentPath & (FileName)
                    end if
          end repeat
end repeat
on AppleScriptDateToString(a)
          set b to current date
          set monthnames to {}
          repeat with i from 1 to 12
                    set month of b to i
                    set monthnames to monthnames & {(month of b) as text}
          end repeat
          set Y to (year of b)
          set M to 0
          repeat with t in monthnames
                    set M to M + 1
                    if t as text = (month of b) as text then
                              exit repeat
                    end if
          end repeat
          set M to Twodigits(M)
          set D to Twodigits(day of b)
          set hh to Twodigits(hours of b)
          set mm to (minutes of b)
          set ss to Twodigits(seconds of b)
          return Y & "-" & M & "-" & D as text
end AppleScriptDateToString
on Twodigits(a)
          return (characters -2 through -1 of (("0" & a) as text)) as text
end Twodigits
on checknamewith_pdfsuffix(n, D, looped)
          tell application "Finder"
                    set thefiles to name of every item of (D as alias)
          end tell
          if thefiles contains n then
                    if looped = false then
                              set n to ((characters 1 through -5 of n) & " 1" & (characters -4 through -1 of n)) as text
  checknamewith_pdfsuffix(n, D, true)
                    else
                              set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
                              set tmpcount to (count of characters of (tmp as text)) + 5
                              set tmp to tmp + 1
                              set n to ((characters 1 through (-1 * tmpcount) of n) & tmp & (characters -4 through -1 of n)) as text
  checknamewith_pdfsuffix(n, D, true)
                    end if
          else
                    return n
          end if
end checknamewith_pdfsuffix

Similar Messages

  • Unrecocognisable email attachments WINMAIL.DAT

    my N95-8Gb sometimes receive unrecocognisable email attachments (WINMAIL.DAT). I can read maybe 1st line of the email msg but unable to view anymore than this. From what I can gather is that msgs seem to be in a format that my n95-8Gb cannot decipher and it just renames the file.
    As I read I generally read all my emails in the html, this is very frustrating....
    Anybody got any ideas, help
    N95 8GB is the Best.

    http://support.microsoft.com/kb/138053
    http://support.microsoft.com/kb/278061
    http://support.microsoft.com/kb/197064

  • IPad will not open email attachments using webmail ?

    Hi We own a iPad 3, OS5.1.1 ( the iPad belongs to my wife ) therefore she has her own account set up using the iPad's email programme ( I do not have my email account on this iPad as we want to keep our accounts seperate)  When I login to my email account using my webmail I can not open any attachement wheather it be pdf.doc,txt ext etc ? when I select the document ( attachment ) nothing happens - if my wife has any pdf's attached to her emails using the iPad's email programme they open without any problems ? I have spoken to my email provider as a webmail programme should be able to open attachments connected with an email - but they are not at all helpful they are suggesting that the problem is with the iPad which I am not at all convinced by unless I am advised other wise by anybody with a technical experience of this problem. We have 3rd party apps such as PDF Reader and also iBooks which can read ePub files - can any body help with this - I am not talking about downloading files here, I am simply talking about the capacity to just open and read an attachment which I can not do with our iPad - we have plenty of memory and drive space, therefore I think it is a bug which might be due to a combination of the webmail programme and the iPad not working with each other - or simply something that is not apparent to me Any help would be much appreciated Many Thanks Mavis

    I had the same problem.
    A colleage sent an email from an ipad with a pdf attachment (via FileApp Pro) and while the email arrived OK and the Inbox shows an attachment there is nowhere to click and open the document from.
    The name of the pdf is listed in the detail of the message but there is no icon within the message to open it with. 
    The first page of the pdf file was shown within the message too.
    The trick was to click and hold somewhere within the first page (displayed in the email).
    This prompts the "Open in ..." popup from which you can open your preferred pdf reader to see the whole document.
    Hope this helps.

  • Email attachments from SSRS email subscription are not being uploaded to an email enabled SharePoint 2013 document library

    Email attachments from SSRS email subscription are not being uploaded to an email enabled SharePoint 2013 document library.
    I have tested the library using a standard email (with attachment) to the library and this works fine. 
    I have monitored the drop folder on the server and I can see both emails being picked up in drop and processed by SharePoint.  The email sent from a regular email account is uploaded with the attachment, whereas the email sent via SSRS subscription
    email is uploaded and the attachment (report) is missing.

    An update on this.  The email when sending from SSRS subscription is received in the library and the attachment is contained within the .EML file uploaded.
    The behaviour that I would like from SSRS subscription emails are to just have the document and not the email.
    Below is a snippet of the .EML files I quick copied from the Drop folder.
    Email attachment snippet sent from SSRS Subscrption:
    ----boundary_2477_75fa3d73-56de-4948-ad82-6588f3a35b95
    Content-Type: application/octet-stream; name="Toilet Usage by Month.docx"
    Content-Transfer-Encoding: base64
    Content-Dis;
     filename="=?utf-8?B?VG9pbGV0IFVzYWdlIGJ5IE1vbnRoLmRvY3g=?="
    Content-ID: <10722c0f-749e-4ecb-ac3f-206317bae734>
    UEsDBBQAAAAIAEVcbEY4Xh4a5nsAAPJtMQARABwAd29yZC9kb2N1bWVudC54bWwgohgA
    KKAUAAAAAAAAAAAAAAAAAAAAAAAAAAAA7N1rr1/XcSforyL4VRooR3vd9to76Kihjto9
    I8T2TDvAzFuaPrE1kUiCouxWPv38DyX50nHSniCdyS96bIAUL+d/LnxO7Vq11qr6j//p
    v3/x+Qe/fnr75WevX/3lD9qfHz/44OnVy9e/+OzVL//yB1+9+9sfXj/44Mt3L1794sXn
    r189/eUPvn768gcf/KeP/uNv/uIXr19+9cXTq3cfPF7h1Zd/8evHH/7q3bs3f/Hhh1++
    /NXTFy++/PPXb55ePf7wb1+//eLFu8cv3/7ywy9evP27r9788OXrL968ePfZzz/7/LN3
    X3/Yj+P8wbcv8/rxXt+++otvX+KHX3z28u3rL1//7bvnN/mL13/7t5+9fPr2p+/e4os/
    5f1+8yaffPshv3+Pj4/l3a++e5Ff/1Pv9tdffP7d3/vNmz/lvf3i7YvfPL6AX3z+zTv6
    Email attachment snippet sent from Outlook:
    --_004_A4C6DCEDE4346446A79AFF493D278530FB87FA07MELABCDEXA1airp_
    Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document;
     name="Toilet Usage by Month.docx"
    Content-Description: Toilet Usage by Month.docx
    Content-Dis; filename="Toilet Usage by Month.docx";
     size=76574; creation-date="Thu, 12 Mar 2015 00:41:14 GMT";
     modification-date="Thu, 12 Mar 2015 00:41:14 GMT"
    Content-Transfer-Encoding: base64
    UEsDBBQAAAAIAMJcbEY4Xh4a5nsAAPJtMQARABwAd29yZC9kb2N1bWVudC54bWwgohgAKKAUAAAA
    AAAAAAAAAAAAAAAAAAAAAAAA7N1rr1/XcSforyL4VRooR3vd9to76Kihjto9I8T2TDvAzFuaPrE1
    kUiCouxWPv38DyX50nHSniCdyS96bIAUL+d/LnxO7Vq11qr6j//pv3/x+Qe/fnr75WevX/3lD9qf
    Hz/44OnVy9e/+OzVL//yB1+9+9sfXj/44Mt3L1794sXnr189/eUPvn768gcf/KeP/uNv/uIXr19+
    9cXTq3cfPF7h1Zd/8evHH/7q3bs3f/Hhh1++/NXTFy++/PPXb55ePf7wb1+//eLFu8cv3/7ywy9e
    vP27r9788OXrL968ePfZzz/7/LN3X3/Yj+P8wbcv8/rxXt+++otvX+KHX3z28u3rL1//7bvnN/mL

  • Trying to change the name to the itunes account and made one myself because my sister use to use my computer and updating my apps where under her email now that i made my own i cant update anything on my phone its still showing my sisters email.

    basically my sister used my computer and everytime we had to update our apps it would be her email thats showing and thats when i knew that pw. since shes doesnt use it anymore i made my own and now it wont let me update it its still showing hers.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iDevice, then sign back in with the ID you wish to use. 
    If your sister doesn't know the password for her old ID, and if her old ID is an earlier version of her current ID, she needs to temporarily recreate the old ID so you can delete if from your phone using her current password.  To do this, have her go to https://appleid.apple.com, click Manage my Apple ID and sign in with her current iCloud ID.  Click edit next to the primary email account, change it back to her old email address and save the change.  Then edit the name of the account to change it back to her old email address.  You can now use the password for her current ID to turn off Find My iDevice on your device, even though it prompts you for the password for her old account ID.  After you do this, Next, have your sister recreate her current ID again by going back to https://appleid.apple.com and changing her primary email address and iCloud ID name back to the way it was.
    Then your can save any photo stream photos that you wish to keep to the camera roll on your device, then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted.  You will be prompted to either keep or delete the iCloud data from your device.  If the data is already in another account you can choose Delete.  If you need to migrate it to another account, choose Keep, then choose Merge when signing into the new account.

  • I keep receiving Reset email password emails. The most recent one was actually addressed to someone else... i.e. the name in the email not the email address. why is this happening??

    I keep receiving Reset email password emails.
    The most recent one was actually addressed to someone else... i.e. the name in the email not the email address. why is this happening?? I am not requesting to reset my icloud email password.

    That's probably because it's been sent out to a Bcc'd mailing list and that's the name on the main version. This is so that you don't see the other names.
    If it doesn't come from something @apple.com then it's spam. Even if it appears to it's probably spam. If you want to change your password go directly to http://appleid.apple.com - do not follow any links in the email (even if they appear to lead to that address.)

  • HT1277 Sending email out from iPhone 4 receive it in my inbox the exact email

    Sending email out from iPhone 4 receiving it in my inbox the exact email

    Is your iOS device configured to copy messages you've sent to yourself?
    Settings > Mail, Contacts, Calendars > Always Bcc myself

  • When sending an email to multiply recipiants, using address autocompletion, all the address boxes convert to the name in the first box

    I use Thunderbird for my email. When sending an email to multiple recipients, I use autocompletion from my local address book. When I select an additional recipient, the name initially appears correctly in the address box. Each time I drop down to add another recipient, the names in each box all revert to the name in the first box. I've used Thunderbird for 2 years and this just started today. Also, the cursor and names in the address box appear now in red instead of black. Hopefully you can solve this problem.
    Thank you,
    bradoc

    There are some evil bugs in the current version of Thunderbird. You may find it works better if you click with the mouse, or move down with the arrow keys and click or use tab. IIRC, there's an issue with use of the Enter key. Or maybe the other way round ; please experiment. It's one of those frustrating bugs that seems to affect everyone but me.
    You can download older versions here:
    https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/
    I believe 31.2.0 is free of this particular issue. 24.6 seems to be a popular choice for those who dislike recent changes in the Composition window UI.

  • E-mails from an email list used to be listed under "Sender" by the individual, but now the Sender is the name of the list and so: how can I go back to how it wa

    I belong to an email list. Until a few days ago, emails to this list arrive in my in-box with the Sender as the individual who sent the email. Now it simply says the name of the email list. This means that I can't know who has sent an email until, and if, the person signed her name at the bottom. I want to go back to the way it was.

    I have never had this problem and can't recreate it however Try this
    '''Open Thunderbird''' choose '''View''' from the menu bar select '''sort by''' and then choose '''From'''
    Answer 2 '''Open Thunderbird''' select '''Tools''' from the menu then '''Options''' select '''Advanced''' select the tab marked '''Reading and Display''' in the area marked '''Display''' there is a '''check box''' which says '''Show only display names for people in my address book'''.
    These may not be the solution let me know

  • TS4002 when I was assigned my ".me accounts.... I used the name of the company that I worked for. Then I received a iCloud account.  The problem is I want to change the two original names but can't because they're greyed out.  Is there anything I can do?

    When I was assigned my ".me accounts I used the name of the company that I worked for. Then I received a iCloud account.  The problem is I want to change the two original names but can't because they're greyed out.  Is there anything I can do?
    Thanks in advance,
    Majormidi

    http://discussions.apple.com/thread.jspa?messageID=3366422
    Odd, the link works for me.
    -mj
    [email protected]

  • How to dynamically set the name of the generated PDF file sent by email

    Hello,
    I am using Reports 10g and I managed to send PDF reports by email, specifying the recipient, subject, format etc, using the reports servlet URL.
    But there is one thing that I cannot find a way to do: I want to dynamically set the name of the attached file. It defaults to the name of the RDF file (eg monthly_sales.pdf). I would like it to be something more meaningful (eg monthly_sales_072010.pdf, where 072010 is the month and year passed by parameters).
    Is it possible to do it?
    Thanks
    Luis

    Use System.load(...) instead of System.loadLibrary(...).

  • Changing the name of the form when attached to an email

    Good Day All;
    I am wondering if there is a way to change the name of an attachment when the email button is clicked.
    Let me explain.
    I have designed a form that will be emailed from one are to another and when the email button is clicked the email attachment is named (example)  “_150s2140t32f8b0iu.pdf”. Of course this is a meaningless name. I would like to somehow change this to better represent the name of the form.
    Thanks for any suggestions
    Thanks
    Chomp

    Hi Chomp,
    It sounds like you are clicking the email button when in Preview in LC Designer. When the form is being Previewed it is given a temporary name. If the form is opened in Acrobat directly, does the email button attached the form with the proper/full name?
    If you want the form to be given a named based on user's inputted data, then you will need a trusted function (.js file) on every user's computer. See this discussion: http://forums.adobe.com/message/2266799#2266799.
    Niall

  • Email workflow showing domain and alias and not the name in the email

    I created an email workflow for a specific user field value to receive an email on a trigger event.
    However, the email received shows the DOMAIN/Alias and not the "Name" in the email content.
    How to correct this error? Not sure where is the issue is.
    Sample:
    Hello [%Current Item: Reviewer%] is the greeting line.
    If Reviewer is say Domain A/v-abcd and Name is Abcd.
    The email reads
    "Hello Domain A/v-abcd" and not "Hello Abcd"

    Hi,
    Just select "Display Name" instead of "Login Name" in the "Return field as" field of Lookup dialog.
    It should help.
    Regards Michael (http://sp2013-blog.com)
    Please, don't forget to upvote and mark as an answer if appropriate

  • Trying to compose a new email. Addind the name in the "TO" ared brings up other names beginning with same letter but I can't clear these other names.

    Addressing an email problem. Manually putting a email address is the TO area brings up other names ( with same first letter) from the contact list. this list of unwanted names freezes in place and won't go away unless I restart Firefox. This list blocks my view of the address and composition area. This has been happening for a few days. If i use Chrome, I don't have this problem...only with Firefox. My OS is XP if that matters.

    Tried clearing. No Change. I select "NEW" then manually type in a email address which then pops up additional names for me to select/ highlight . I can select or highlight additional names if i want to but I can't get rid of the names or the window where these names appear. Even if I select my IN BOX or SENT this window with all the names is there and obstructs my view and use. It can't be deleted

  • Mail running under LIon no longer grays out the name of the sender of an email that has been read.  How can I get that to happen?

    Under the old version of Mail, when an e-mail was read, the name of the sender was greted out so that I knew I had read that email.  This does not seem to happen under the new Mail thaqt came with Lion.  Help!?
    Chuck Humphrey
    [email protected]
    303-997-2755

    Kirk,
    Thanks again for your suggestions. No, I don't get an
    error message. In fact nothing happens. My name and
    key are typed in and from what I understand, once you
    do that with a real key it directs you to the
    registration page. When I get done entering the
    information the window just sits there without any
    button or option to continue.
    QT Pro is already in the QT (non-pro) you installed and the key (which is a hash of your name in part) allows the Pro features to work.
    No redirect, internet, nothing like that. As such many people have activated and think they haven't. Just look at the menu items and see if the "Pro" logo is shown next to a few (which are greyed out and not available without Pro). If not you are done.

Maybe you are looking for

  • FM for change log

    Hi All       Is there any FM to create the change log in the standard transaction when we make some changes. i.e. I am currently changing the tax classification number in customer master using the FM 'CUSTOMER_UPDATE' but this FM will not create the

  • Disconnecting take long time ...

    Hi , Sometimes when i disconnect from vpn connection , it took for a long time to disconnect and i can't connect to that vpn again, because status remain disconnecting ... . i should restart my mac to connect to that vpn again ! What should i do ?

  • Error message when trying to email from iPhoto

    Just spoke to Apple support because I was unable to email from iPhoto unless I went through Mail (i.e. no templates). I had struggled with this for some months. The patient and helpful Apple people solved the problem after a couple of hours. Two-step

  • Pismo powerbook making a strange "beeeep" sound -any idea what this mean..?

    I have had various problems with my Pismo for a while (have had to reinstall the system every month or so, please see my other post for details). Then the other day, it made a loud "beeeeep" sound. Actually it must have made this sound 3 - 4 times ov

  • Where is the sidebar??

    I was having lots of trouble with the latest update on my IPad 2, and someone suggested I sync it to the computer and do the updated update though that.  Turned on ITunes to do that, and again, the sidebar has disappeared.  I cant work without it, an