Applescript to add mail content to spreadsheet

Please help I know enough to be dangerous with Applescripting
I would like to add a script to a mail rule to put my banking transaction notification email into a spreadsheet.
I would like to extract the records from the text in the Mail subect line and put them into a spreadsheet with 5 Fields
The incoming mail has a subject line with -----
"RMB Private Bank:-) R553.85 paid from Single Fac. Acc..009939 @ Scheduled Pymt. Ref.Hamptons Levy-17. 28Sep 06:13"
I would like to add this to spreadsheet called "inContact.xlsx"
Using Fields
1. Account - "RMB Private Bank"
2. Amount - "R553.85"
3. Date - "28Sep 06:13"
4. Item - "Hamptons Levy-17"
5. Card Details - "Single Fac. Acc..009939"
Can anyone help PLEASE

Each scriptable application has a dictionary that contains the terminology and commands tha it knows about.  The various scripting dictionaries can be opened in the AppleScript Editor, and added to its library for future reference if desired.
In this case, you will find that a Mail message has quite a few properties, which include date sent, date received, and sender.  These items (and whatever else you want to use) can be included in the text file by adding statements such as:
  set contentsText to contentsText & (sender of anItem) & return
  set contentsText to contentsText & ((date received of anItem) as text) & return

Similar Messages

  • Why doesn't the "Mail" content box?

    When I try add mail content box. It does not appear in the "Add Content" box. Why? "Mail" should be between "Organization View" and "Profile" content box. I restarted a few times.

    Thanks Sreadhar. How do I know I will "Adding Resource Catalog Components to Pages." But there isn't "Mail" component.
    Edit first messsages: Mail component should be between "Forums" and "Members" components. But isn't there in my WebCenter Portal.
    Sory for my poor English.
    Must be:
    My Webcenter Portal:

  • Add Bullet point in mail content in send mail

    Hi,
    Can you please let me know how to add Bullet point in the mail content while sending email from SAP programatically??

    do you generate mails by custom program?
    if yes, you can create a mail with body in TXT or HTML formats. For TXT, simply use a star (*) character. For HTML, use
    <ul>
    <li>first bulleted line</li>
    <li>second bulleted line</li>
    </ul>
    To send HTML body from a custom program, some examples are listed in wiki Sending Mails - Home Page.

  • How to get Formatted Mail Content through Java Application

    I am using a mail sending function in my applet code which is listed below:
    Main content is fetched from a format tool bar in JSP Page and it is passed as parameter to applet and it is used inside the mail content.
    Same content when passed and executed in a JSP page, the formatted content is not lost and it is included in mail content as what it is fetched from Format Tool Bar.
    Format is lost when it is used inside the Java Application mail sending function.
    The below code I have used to send mail:
    package com;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.mail.BodyPart;
    import javax.mail.Message;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    class mailsendClass
    public void sendmail(String from,String host,boolean debug,String msgText)
         try
              Set tomailsid = new HashSet();
              Set ccmailsid = new HashSet();
              //to mail ids           
              tomailsid.add("[email protected]" );          
              tomailsid.add("[email protected]" );
              tomailsid.add("[email protected]" );
              //cc mail ids
              ccmailsid.add("[email protected]" );
              ccmailsid.add("[email protected]" );
              String mailarray[]= (String[])tomailsid.toArray(new String[tomailsid.size()]);
              String ccmailID[]= (String[])ccmailsid.toArray(new String[ccmailsid.size()]);
              Properties props = new Properties();
              //props.put("mail.smtp.port","425");
              props.setProperty("mail.smtp.host", host);
              if (debug) props.setProperty("mail.debug", ""+debug);
              Session session = Session.getInstance(props, null);
              session.setDebug(debug);
              String mailsubject = "Mail Subject";
              // create a message
              Message msg = new MimeMessage(session);
              msg.setFrom(new InternetAddress(from));
              javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[mailarray.length];
              for (int i=0;i<mailarray.length ;i++ )
              toAddress=new javax.mail.internet.InternetAddress(mailarray[i]);
              System.out.println ("id inside to address loop " + i + " is "+ mailarray[i]);
              System.out.println ("toAddress " + i + " is "+ toAddress[i]);
              msg.setRecipients(Message.RecipientType.TO, toAddress);
              msg.setSubject(mailsubject);
              try
                   javax.mail.internet.InternetAddress[] CCAddress=new javax.mail.internet.InternetAddress[ccmailID.length];
                   for (int i=0;i<ccmailID.length ;i++ )
                        CCAddress[i]=new javax.mail.internet.InternetAddress(ccmailID[i]);
                        System.out.println("CC Array is ===> " +CCAddress[i] );//          
              msg.setRecipients(Message.RecipientType.CC,CCAddress);
              catch(Exception ss)
                   System.out.println("CC mail Exception is ====>"+ ss);     
                   msg.setSentDate(new java.util.Date());
    //          Multipart multipart = new MimeMultipart("relative");
                   Multipart multipart = new MimeMultipart("alternative");
              BodyPart messageBodyPart = new MimeBodyPart();
              messageBodyPart.setContent(msgText, "text/html");
    //          messageBodyPart.setContent(msgText, "text/plain");
              multipart.addBodyPart(messageBodyPart);          
                   msg.setContent(multipart);
              Transport.send( msg );
         catch (Exception e)
              System.out.println("The Exception is ------>"+e);
    public class SendMail {
    public static void main(String[] args)
         System.out.println("before Mail Send ");
         mailsendClass mail = new mailsendClass();
         String from="[email protected]";
         String host="172.16.2.6";
         String msgText="<p><strong>Index</strong><br />I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:<br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///Index' href='ftp://index/'>ftp:///Index</a><strong><br />XML Coding - Files with errors</strong><br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///XML_Coding_Need%20Fixing' href='ftp://xml_coding_need%20fixing/'>ftp:///XML_Coding_Need%20Fixing</a></p>";
         mail.sendmail(from,host,true,msgText);
         System.out.println("after Mail Send ");
    Content placed in format tool bar is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    ftp:///Index
    XML Coding - Files with errors
    • Engage
    • Chapters 1–6
    ftp:///XML_Coding_Need%20Fixing
    Content fetched from format tool bar inside JSP page is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Fetched Content inside Java Application through parameter and it will use as input for mail content is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    • Engage
    • Chapters 1–6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Actual mail received after Java Application execution is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    ? Engage
    ? Chapters 1?6
    ftp:///Index
    XML Coding - Files with errors
    ? Engage
    ? Chapters 1?6
    ftp:///XML_Coding_Need%20Fixing
    Unicode characters in the mail content are replaced by “?”.
    In the function listed above I have used the MIME Setting as
    Multipart multipart = new MimeMultipart("alternative");
    I have tried by using “relative” MIME format also as
    Multipart multipart = new MimeMultipart("relative");
    But I am not getting the actual format passed as input to the Java Application in the mail content.
    Can anybody let us know how to overcome this problem?
    Thanks in advance.

    You need to really understand how the different multiparts work instead of just guessing.
    But for your application, you don't need a multipart at all. Just use msg.setText(msgText, null, "html");
    Although that doesn't explain your problem, it will simplify your program.
    How are you determining that the mail received doesn't have the formatting? Are you viewing it in a
    mail reader (e.g., Outlook)? Or are you fetching it with JavaMail?
    Are you using an Exchange server? Exchange will often reformat your message to what it thinks you meant.

  • Urgent!!! How to convert received mail 'content type?

    How to convert received mails 'content type from text/plain to multipart/*?

    you cannot change the content type of a Message object which has been received. What you can do is create an instance of a MimeMessage class and set the content type as multipart and then add the received message as a bodypart to that message.
    You can look at the javamail example codes as to how to create a new MimeMessage with multipart content.
    anurag

  • NaN on the run (add cell contents) [CS3, JS]

    Hello.
    This is my first attempt at javascripting ID, though I've done some amount of Applescripting.
    The intent of this script is to add the contents of the table cells that a user has selected.
    I can't figure out why this keeps returning 'NaN' (not a number) after I have told it to ignore any 'NaN' contents (and exclude them from the running total).
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    var theTotal=0;
    //If the selection is at least one table cell...
    if (app.selection[0].constructor.name == "Cell")
    //count cells in selection
    var cellCount=(app.selection[0].cells.count(0));
    //repeat with count from 1 to count of cells
    for (a=0; a<=cellCount; a++)
    //get contents of first selected cell in the loop
    cellVal=(app.selection[0].contents[a]);
    //convert string to # via parseFloat command
    cellValInteger=parseFloat(cellVal);
    if (cellValInteger!="NaN") //NaN = not a number
    //set the variable to the sum of each cell value
    theTotal+=cellValInteger;}
    else{
    alert("Please fully select at least one table cell and try again.");

    Bob and Dave, many thanks for your help. It works now, and my next challenge is to figure out how to put that data into the last cell.
    Aaron

  • Change Mail content for standard mail 'Simultaneous logon approval required' in 2 Envelop RFx

    Hi Experts,
    Please suggest, we have a requirement where we need to Change Mail content for standard mail 'Simultaneous logon approval required' and Simultaneous Logon Successful in 2 Envelop RFx in SRM.
    Thanks.
    Regards,
    Gaurav

    Hi Gaurav,
    please implement BADI /SAPPSSRM/BD_SIM_LOGIN
    Enhance Simultaneous Logon
    Use
    You can use this Business Add-In (BAdI) to incorporate customer-specific functions into the initiation and completion processes for simultaneous logon and to adapt simultaneous logon e-mail notifications.
    Method PROCESS_FINISH
    You use this method to add customer-specific functions to the simultaneous logon process. This method is called on completion of the simultaneous logon process.
    The following parameters are provided
    IV_EXT_GUID
    Process ID of the external process
    IV_MODE
    Indicates the mode of the e-mail function (completion)
    CV_SUCCESS
    Indicates whether the process was successful
    IV_SET_GUID
    Process ID of the customer-specific process
      Method PROCESS_INIT 
    You use this method to add customer-specific functions to the simultaneous logon process. This method is called on initiation of the simultaneous logon process.
    The following parameters are provided:
    IV_EXT_GUID
    Process ID of the external process
    IV_MODE
    Indicates the mode of the e-mail function (initiation)
    IV_SET_GUID
    Process ID of the customer-specific process
      Method SIM_EXT_MAIL 
    You use this method to change the content of the e-mail sent to participants on successful initiation, completion or failure of the simultaneous logon session and to define the external process that is calling the simultaneous logon application.
    The following parameters are provided:
    IV_OBJECT_ID
    Business object identifier
    IV_MODE
    Indicates the mode of the e-mail function (initiation, completion or failure)
    IV_EXT_MODE
    Indicates the external process, for example, technical RFx response opening, of the calling application. This could be any process for which you want to use simultaneous logon.
    CT_MAIL_BODY
    Content of the e-mail
    CV_MAIL_SUB
    Subject line of the e-mail
    Standard settings
    If the customer does not define a BAdI implementation, SAP delivers a default BAdI implementation. The default implementation incorporates the simultaneous logon process with the two-envelope RFx response process. You cannot use the simultaneous logon process with standard RFxs in the default implementation.
    Activities
    Information about the implementation of BAdIs in the context of the enhancement concept is available in the SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.
    Regards,
    raghuveer

  • Changing E-Mail Contents?

    Dear SDNers,
    I followed the steps mentioned in the URL http://help.sap.com/saphelp_nw04/helpdata/en/33/d494c86203ea40b7b44ddd471baab1/frameset.htm for changing the text of the mail which is sent to the Users.
    Here i have two questions:
    1) In the link mentioned above, it says that there are few placeholders of which "Free text. This is the text that the administrator or user can add in a text box, for example when creating a new user. In general, the free text placeholder should never be removed." I want to know how this placeholder of can be used.
    2) I did some modifications in the notificationTexts.properties file as per thr link above and modified the TEXT_CREATE_PERFORMED tag. But i want to know when and where each tag is used for. I mean for what requirement i have to change which tag. for ex there is one more tag TEXT_CREATE_BY_BATCH_PERFORMED for user creation.
    Also if i want to modify the mail text, what would be best to modify the or the tab directly?
    Please help on this...
    Regards
    Gaurav Gandhi

    HI Pedro
    Thanx for the reply. I have also modified the TEXT_CREATE_PERFORMED tag and uploaded back through config tool and it is working fine. But i want to know abt the placeholder as per the link mentioned in my question.
    Also i would like to know where each of these tags in the properties file are used. like suppose if i have to change the mail contents for user creation mail, which tags do i have to modify?? What does the other tags mean?
    Regards
    Gaurav Gandhi
    Message was edited by: Gaurav Gandhi

  • Can't Mail Contents of this Page after MobileMe update!

    In Safari, you used to be able to do a "cmd I" or go to the File Menu and go down to "Mail Contents of this Page" select it and it would paste in to Mail a screen shot of the Safari page you were on.
    Now when you do this, after the MobileMe update has been run and installed. Safari no longer can find the Mail app. Here is a copy of the text of the error message that you get now.
    "Safari couldn’t create an email message because it couldn’t locate an email application.
    You can use the Mail application included with Mac OS X to send webpages. To do so, you need to install Mail using the Mac OS X installation CDs."
    I'm on a MacBook 2 Ghz INtel Core 2 Duo, with MAC OS X (10.5.2), Mail version 3.4 (last modified 7/11/08) Safari version 3.1.2 (last modified 6/30/08), MobileMe version 5.1 in the Preference Pane.
    The suggested solution of reinstalling mail would not seem to work as it would reinstall older versions of mail that would not have the functionality of being use MobileMe. It would seem to be that a Safari path is what is required to have the code know that the Mail app has been renamed(?).
    CW Rice
    Sheldonville, MA

    Hi, I'm on 10.5.4 I must have mistyped my OS version number. I took the version number for MobileMe from the About This Mac information. I was surprised like you see a version number of 5.1 I have run Software update as well just now to see if any newer versions of my software are there. None I'm up to date.
    I do know that when I ran the MobileMe updater it said that it fixes problems in Mail, right now some things in various software applications still refer to .Mac. I still think that somewhere in the Mail app that the name was changed, so that Safari is looking for the old name in a string of code that executes the placing a copy of the current page in Mail as an outgoing mail message.
    As for that activity bar in Safari, I guess I have never noticed it until now, on a laptop the bottom of the page is some times obscured by the dock which I have at the bottom. I truly noticed it more when I ran the MobileMe page.

  • Business Workplace Inbox : Mail Content Not Displayed

    Friends,
    We have a problem in displaying contents of the mail(SAP Inbox) in one of the PC's. When we reply w/refernce to that message the content is displayed properly. And also the same mail content is displayed properly in another PC's for the same user.
    We thought this is a GUI problem and re-installed SAP GUI(all components) but still the issue exists.
    Any other settings are required to be done to solve this problem? Can anyone please help us solving the issue?
    Note: we are using SO_DOCUMENT_SEND_API1 for creating the mail notification and the content is passed as 'RAW'.
    Thank you very much for your help and suggestions.
    Cheers,
    MS
    Message was edited by: Srinivasa Maram

    Srinivas,
    1) Is the problem only with the message being sent through custom code using SO_DOCUMENT_SEND_API1? What happens if you send a message using SAPOffice?
    2) Are the patch levels of the GUI same on both machines? Are you sure both PCs are configured exactly the same? Especially wrt to Windows & IE patches. I vaguely remember there were some issues a while ago with some IE patches. Normally in most client environments the desktops upgrades are controlled centrally and users do not have admin rights. Make sure the user has not done upgrades/installs on the PC in question. If that were the case the PC may needs to be reimaged.
    BTW - What version  are you on R/3 and SAPGUI?
    Regards,
    Ramki Maley

  • How to make "Mail Contents os this page" in safari 7?

    Hi everybody,
    I need for my daily work to make once or twice a day an upload of an mailing PNG picture. Bevor the upgrade to Maverick Safari 7 I used the safari version 5.1.10 which works great to make "Mail contents of this page" (File Menu > Mail Contents of this file). Now in the Safari 7 version this option is not anymore available and it is change to SHARE "Email this page". This is not the some and it does not match the legal proposing.
    I appreciate as answer for a good solution or which steps shoud I do to get this option again.
    Thx a lot

    Hi Carolyn,
    Thanks a lot for your help and sorry for the inconvenience. I follow your instruction but it is still not working.
    I tried to use now another Mac which I have here, with Mac system 10.6.8, where I use the safari version 5.1.10 (6534.59.10) and it works perfect.
    Here are the screenShots:
    The screenshot from the older computer: here you see the option Mail contents of this page.
    Using that older Mac we have the perfect result, where you see the legal text + images, which i sent to me in bcc.
    The result from my Mac with Maverick and after following the instruction:
    You see the full legal text but no the image!
    Maybe this is just a minor bug in Safari, to exploring yet and to improve. For the meantime I have to use the older Mac only for this part of the job. Not A PERFECT DAY (lou reed, RIP) but not the end of the world!
    Thanks for you help and I´m looking forward to get news on this issue from you.
    <Image Edited By Host>

  • I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts

    I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts.   All the instructions on synching start with "find your device in the device window".  But what if you have no device window?

    Missing "message" from above: The iPad "DGMTR" is synced with another iTunes library on DGMTR's MacBook Pro. Do you want to erase this iPad and sync with this iTunes library? An iPad can be synched with only one iTunes library at a time. Erasing and syncing replaces the contents of this iTunes library.
    I thought the libraries were the same.

  • How can I add new content in iDVD to a DVD-RW disc which has ample remaining free space? After preparing the new video for burning and clicking on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject.

    How can I add new content in iDVD to a DVD-RW disc with a video previously successfully recorded on it? (The disc has ample remaining free space.)
    After preparing the new video for burning and clicking in the File menu on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject. My assumption has been that iDVD would automatically find the free space and continue with the new recording from there. I'd be grateful if anyone can shine light on this.

    There are, but not with a DVD written as a movie disk. It must be closed when completed, or it doesn't work.
    Apple's built in Burn utility also automatically closes any data CD, DVD or Blu-ray disk you burn. Doesn't matter how much space is unused, you can't use it. You'd have to use a more advanced disk creation app, such as Toast Titanium. I then have the option of choosing to write the data as a session:
    I can keep doing this until the disk is full. If I've written five sessions to the disk, when I put it in the drive, five CD/DVD icons will appear on the desktop since the OS will treat each session as if they are separate physical disks. At any point you choose Write Disk when writing a group of data, that means you're closing the disk, and again can't add anything after that. So if I had written two sessions, and the third was Write Disk, it's over. I can't put anything else on that disk.

  • I have two computers one 10.5.8 one 10.6.8.  Updated the 10.6.8 and now my mail has disappeared on one computer - do I sync account to get all my mail content back?

    I have two computers one IMac 10.5.8 one MacBookPro 10.6.8.  Updated the MacBookPro 10.6.8 and now my mail has disappeared on that computer - do I sync account to get all my mail content back onto the MacBookPro?

    You can do it. This article from Macworld will be helpful to you:
    http://www.macworld.com/article/161087/2011/07/install_lion_over_leopard.html
    I recommend the "brute-force" method.
    Just make sure you have your data backed up properly!

  • How do I save e-mail content on my MacBook Air,so I may print them as plain text?

    How do I save e-mail content on my MacBook Air, so I may ptint the content as plain text?

    10.7 Lion
    http://support.apple.com/kb/PH4858
    10.8 Mountain Lion
    http://support.apple.com/kb/PH11746

Maybe you are looking for