Any Mail + Applescript experts?

I've been playing with a "bottom posting" script, kindly supplied by John Gruber. I modified it slightly so that it deletes the top line "On 25 Aug 2008, at 9:49, John Doe wrote:" and replaces it with text. However, I can't figure out how to put the sender's name after my new text. Here's the script so far:-
tell application "Mail" to activate
tell application "System Events"
........tell process "Mail"
................tell menu bar 1
......................click menu bar item "Message"'s menu "Message"'s ¬
..............................menu item "Reply"
...............end tell
...............delay 0.5
...............key code 117 -- Forward Delete blank line at top
...............keystroke "k" using control down -- delete "John Doe wrote" line
...............keystroke "Here is some text from " -- (I want sender's name here)
...............key code 125 using command down -- cmd+down arrow - put cursor at bottom
...............key code 36 -- Return
...............end tell
end tell
Does anyone know how to get the original message sender's name and paste it in?
I'd also like to know how to paste in the name, subject line and other parameters.
(This is purely a learning exercise for me.)
I have bought "AppleScript The Definitive Guide (v2)" from O'Reilly and I'm gradually working my way through but it gives very few Apple Mail examples and that's what interests me right now.
Martin

BlackBerry Travel isn't smart. Did it see the change as entirely new flights? If you have automatic scanning on then it probably added those flight to what you already have. Same thing happens to me when I get check in reminders and upgrade notifications, and I end up with duplicate flights and hotels in Travel.
As far as what is monitored, you may get notices of gates and delays for the particular flight. But you will probably get the gate notification after you've already figured it out yourself and you are at the gate.
- Ira

Similar Messages

  • TS2998 After upgrading to Snow Leopard, Mail will not let me archive any mail. All archived messages re-appear in my inbox (I have tried archiving and placing in the trash bin).

    After upgrading to Snow Leopard, Mail will not let me archive any mail. All archived messages re-appear in my inbox (I have tried archiving and placing in the trash bin). How do i regain control of my inbox?

    The main differences that can cause a problem are scripting additions (64-bit vs 32-bit and security reasons) and the usage of dates (it is not as forgiving). AppleScript itself is basically the same, so if empty paragraphs are what caused your problems the update would have just been a coincidence.

  • Mail applescript not working

    I'm writing a script using the Mail applescript template (File > New from template > Mail > Mail Rule Action.scptd) but it doesnt seem like the examples in the template are working
    using terms from application "Mail"
              on perform mail action with messages these_messages for rule this_rule
                        tell application "Mail"
                                  set the message_count to the count of these_messages
                                  repeat with i from 1 to the message_count
                                            set this_message to item i of these_messages
                                            try
                                                      set this_subject to (subject of this_message) as Unicode text
                                                      if this_subject is "" then error
                                            on error
                                                      set this_subject to "NO SUBJECT"
                                            end try
                                    say this_subject
                                  end repeat
                        end tell
              end perform mail action with messages
    end using terms from
    It says "no subject" even if the message has a subject. I'm using OS X 10.7.2 and Mail 5.1. Any suggestions?

    Pierre,
    Are you using os 10.7.2?  The reason I ask is that my code does not have the word unicode in it and it still does not work.  Works fine when I select apply rules from the menu.  Does not work when mail processes rules as the email is first received.
    using terms from application "Mail"
              on perform mail action with messages theMessages for rule theRule
                        try
                                  tell application "Mail"
                                            set theText to "Still not working!"
                                            repeat with eachMessage in theMessages
                                                      set theSubject to subject of eachMessage
                                                      set theBody to "Voice message --> " & return
                                                      set messagePhone to rich text ((offset of "(" in theSubject) + 1) thru ((offset of ")" in theSubject) - 1) of theSubject
                                                      tell application "Address Book"
                                                                set myList to every person
                                                                repeat with i from 1 to number of items in myList
                                                                          set thePerson to item i of myList
                                                                          tell thePerson
                                                                                    set phoneList to every phone
                                                                                    repeat with i from 1 to number of items in phoneList
                                                                                              set this_item to item i of phoneList
                                                                                              tell this_item
                                                                                                        set thisPhone to value as string
                                                                                                        ignoring hyphens and punctuation
                                                                                                                  if thisPhone is equal to messagePhone then
                                                                                                                            set theSubject to "Voice Message From " & name of thePerson & " " & thisPhone
                                                                                                                            set theBody to theBody & return & name of thePerson & " --> " & organization of thePerson
                                                                                                                  end if
                                                                                                        end ignoring
                                                                                              end tell
                                                                                    end repeat
                                                                          end tell
                                                                end repeat
                                                      end tell
                                                      try
                                                                set theAttachments to every mail attachment of eachMessage
                                                                set theAttachment to item 1 of theAttachments
                                                                set thisFilePath to "/Users/Tom/Downloads/" & theSubject & ".wav"
      save mail attachment 1 of eachMessage in thisFilePath
                                                                set theFile to POSIX file thisFilePath as string
                                                                set theMessage to make new outgoing message with properties {subject:theSubject, content:theBody}
                                                                tell theMessage
                                                                          make new recipient at end of to recipients with properties {name:"Tom Moore", address:"[email protected]"}
                                                                          tell content of theMessage
      make new attachment with properties {file name:thisFilePath} at after first paragraph
                                                                          end tell
                                                                          send
                                                                end tell
                                                                tell application "Finder"
                                                                          delete theFile
                                                                end tell
                                                                set theText to ""
                                                      end try
                                            end repeat
                                            if theText is not equal to "" then
      display dialog theText buttons {"OK"} default button 1
                                            end if
                                  end tell
                        on error
      display dialog theText buttons {"OK"} default button 1
                                  beep 2
                        end try
              end perform mail action with messages
    end using terms from

  • I have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being rec.

    i have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being received by my ipad, which is set up with my mail server. What haven't i checked lol?

    turn your ipad off by holding the sleep wake button for 5 seconds and slide to turn off then turn it back on and the apps should be finished and if the apps didnt finish just redownload them

  • I just downloaded AOL Desktop 1.7 for Mac and I can't get my email to work. It welcomes me but I know I have new email but it doesn't recognize that I have ANY mail at all. HELPPPPPPPP Please

    i just downloaded AOL Desktop 1.7 for Mac and I can't get my email to work. It welcomes me but I know I have new email but it doesn't recognize that I have ANY mail at all. HELPPPPPPPP Please

    Hey I've been all over and can't get any help. I'm well aware its not an Apple product but its an app for Mac OS so I thought I'd try here. I bought 2 new iMacs yesterday for my parents (5K) and I'm just trying to get them some help as there in their 70's and AOL is all they know.
    But hey thanks for your help,

  • HT1212 I received a replacement iphone for one that went bad and I think I have everything set up ok, except that on my mail account on the screen it is registering 373 pieces of mail and I can not get it to go away.  There isn't any mail in the email acc

    I had an iphone that would not work and they sent me a replacement.  I have everything set up the same as my last one except that now on the screen it registers 373 on the mail button.  I don't have any mail in my mail box.  Everything is cleaned out but it still registers 373 on the front of my phone.  How do I get this to go back to normal?

    If your email account offers a webmail access, I suggest checking the webmail - log in to your account using the webmail access, and I predict you will see all those "unread" emails there and can dispose of them from there.
    This happens because the iPhone that went bad, when reading those emails, did not remove them from your email provider's servier.

  • I forgot my iCloud password, and i can not reset it with email authentication, when i do it, i don't receive any mail from Apple

    I forgot my iCloud password, and i can not reset it with email authentication, when i do it, i don't receive any mail from Apple

    If you don't know your password, don't know your security questions and don't have a rescue address or don't receive a reset email, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

  • I bought last week (Adobe Acrobat Professional XI) through the website and I received an e-mail to confirm the purchase, but so far I have not got any mail to be able to download the software  My order number: MENA 9723990859

    I bought last week (Adobe Acrobat Professional XI) through the website and I received an e-mail to confirm the purchase, but so far I have not got any mail to be able to download the software
    My order number: MENA 9723990859

    you can download and start your 30 day trial any time.  when your serial number arrives, you can activate your trial to the time-unlimited version.
    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5 | 1
    Contribute:  CS5 | CS4, CS3 | 3,2
    FrameMaker:  12, 11, 10, 9, 8, 7.2
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • I'm not receiving any mail into the Junk Mailbox

    Hi
    I had a problem with the ports of the 2 accounts that I have set up in Mail (one of those is mac.com) due to an excess of space used. I tried several options and it finally it worked. As a result, a week later I realised that I was not receiving any mail into the Junk Mailbox... I don't know if it is related to the orher problem, maybe not.
    Essentially I am no longer receiving any junk mail at all - and no mail that is even doubtful (ie from an unknown address). The mails are not showing up even online via MobileMe ... so I have no idea where they are!
    Any help would be much appreciated. Thanks.

    Yes, I'm the author of the form and I expected the generic notification to be sent to that email but none is coming through.  I also see that there is a place on the settings page to enter a custom notification email but that is grayed out unless I upgrade.  I just want at least one, generic email to be sent to me so that I can know when a user submits a form.
    Here's my screen shots:
    http://peteraudenas.com/wp-content/uploads/2013/08/user-account-screen-shot-1.jpg
    http://peteraudenas.com/wp-content/uploads/2013/08/user-account-screen-shot-2.jpg
    Your Thoughts?  Thanks!
    Joe

  • Server Admin cannot update any mail settings on nearly fresh 10.4 server

    I can no longer use the Server Admin application to change settings under Mail (and I need to make some changes - would like to change logging settings and require authentication for SMTP). I made some initial settings with no problems, but now it chokes...
    For example, I click on Mail, Settings, Advanced... and then try to click the box to require Kerberos Authentication for SMTP-- everything is normal until I hit SAVE. Then there is a delay of 10 or 15 seconds, followed by the error message:
    "A connection with a server or service was lost. Try to disconnect from XServe.local and then reconnect, or contact your network administrator."
    At this point the mail indicator is red, not green... after clearing the message the changes I've made to settings appear intact, but if I quit server admin the truth comes out... I'm asked would I like to save changes, if I say yes the error will repeat-- I have to quit without saving. Relaunching Server Admin reveals that indeed the changes have not been made.
    I've heard of this type of problem when hand editing config files, but I've not done that with any mail-related files (I made two minor changes to a http config file a while ago, otherwise it's all been through Server Admin).
    Is there any way to reset the mail-related files so that Server Admin will return to life, or do I have to reformat the drive and reinstall OS X 10.4.4 hoping it doesn't happen again?
    By the way, the problem started a few days ago, and the upgrade to 10.4.4 didn't magically cure it.

    I'm having the same problem (and updating to 10.4.5 did not fix it either).
    In my case, it takes 30 seconds for the "A connection with a server or service was lost." to come up; I have a lot of mailing lists, and was wondering if it was some sort of timeout value on the server admin server end. (I hope that Server Admin doesn't write out every mailing list's membership every time you change any Mail setting!)
    You can make some changes using the serveradmin command line tool. For example, I noticed this problem when trying to turn on log-rolling.
    First, to find the appropriate command:
    sudo serveradmin settings mail > mailsettings
    I grepped for "log":
    grep "log" mailsettings | grep -v mailman
    (grep -v mailman drops any mailman settings, such as all of the users where "log" appears in their e-mail address)
    And found:
    mail:postfix:logrolling_daysenabled = no
    I then ran the command:
    sudo serveradmin settings mail:postfix:logrolling_daysenabled = yes
    to turn log rolling on. Quitting Server Admin and getting back into it showed that logrolling_daysenabled was enabled.
    So that might be a temporary solution for simple changes.
    In my case, this is a very fresh server: purchased and put into play over a period of three weeks. It worked until I copied the mailing lists over, but a small number of mailing lists copied did not trigger the error. This is what leads me to believe there is some kind of timeout happening.
    Jerry

  • Mail IMAP after 10.5.2 can't read ANY mails in boxes with non-ascii names

    I have Mail with IMAP that connects to a regular MAC OS X Tiger server running IMAP.
    After upgrading to 10.5.2 on the client, Mail can no longer read ANY mails at all in any mailbox whose path contains a non-ascii character!
    Hence: If a box is called 'Övrigt', it only lists the mails in the mail box, but it will not show any of the contents of any of the mails! Hence, I cannot access any of these mails! Catastrophic!
    I have to downgrade to 10.5.1, unless someone knows of a workaround.

    Same problem here (or at least in part). Some .mac folders did no longer show any messages, while they were there and could be seen online and with Thunderbird. After your remark I changed the name of a folder which contained a "´" and now it works. It is really strange because there is another folder with a "¨" in it which does not work (I will test if the name change works with this folder as well in a minute) whilst there is another one with such name which works fine. The update really messed up Mail and in Dutch we just use such characters so Mail without supporting them will be rather useless for me...

  • I upgraded to lion today and just realized I am not receiving any mail. I can send out but not receive. i'm using a POP Road Runner account. Any help appreciated.

    I just upgraded to Lion today and realized I'm not receiving any mail. I can send out but not receive. I am using a POP server Road Runner acct. Any help would be appreciated.

    Try Mail->Window->Connection Doctor.  If there is a problem reported, try:
    Open Mail->Preferences and check your settings.
    If you still have a problem, Copy your settings (screen capture ⇧⌘4), delete account, and re-setup account

  • I didnt receive any mail after i reset my password

    hi there , my id is : *******  , and i hv change to ******** before ,  after that i try to log in , but both also cant log in .  and my password previous is  ******* .. now i try to reset my password .. but i nvr get any mail  .  can pls check for me .tq  very much .
    <Personal Information Edited by Host>

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple - I've asked the hosts to remove your email addresses (and password) from your post (it's not a good idea to post personal info on any public forum).
    You've checked the spam folder as well as the inbox on both email accounts, and (if you have on the iTunes account) your rescue email account ? If it's not there either then try contacting Support in your country to get it reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    If your country isn't on that page then try this form and explain and see what they reply with : https://ssl.apple.com/emea/support/itunes/contact.html

  • Can't send any mail since Safari 3.2 update

    I have updated Safari to v.3.2 and been unable to send any mail ever since. I use Mail 3.5. I've tried everything, checked all the settings, still doesn't work. It's Ok to receive mail. When I try to send anything I get the message "e-mail address rejected by the smtp server".
    On my PC mail is working just fine. Please help me if you know how to fix it.

    Same with me! No mail goes out anymore! It just says "Sending" in perpetuity, even if there's nothing in the Outbox!

  • HT5787 I forgot to answer the secret question camels Store account and you follow the steps in the site account settings but I have not got any mail explains what are the steps involved

    I forgot to answer the secret question camels Store account and you follow the steps in the site account settings but I have not got any mail explains what are the steps involved

    Call your contry's number from http://support.apple.com/kb/HE57 and ask to speak with Account Security.

Maybe you are looking for

  • SCREEN RESOLUTION IN BDC

    HI, CAN ANY ONE TELL ABOUT SCREEN RESOLUTION IN BDC. REGARDS. B.SREENIVASULU.

  • I have created a site but can't open it in iweb after it has been done.

    I created a site using iweb, and then tried one of the free templates that a website was offering. After I open the template I was no longer able to open the site I created. I can locate the files in the Sites folder, but it will not allow me to open

  • Help with downloading

    I have a new iMAC and when I purchase songs from itunes my songs are not being downloaded to my iPod. I have reinstalled iTunes twice already and still I am having the same problem. Any hope?

  • AutoSubmit kills validation on page

    Hi.... I have a jspx page which has required inputtexts and buttons... one of these inputtext has autosubmit=true attribute...and a outputtext after this inputtext which has partialtrigger=this inputtext..... The problem is....While required inputtex

  • Checking contacts changes

    My phone has a feature where it lights up and says it's checking for any contacts adds/deletes. Seems to do it a lot when I go to use phone, so have to wait until it's through to use.  It also lights up in the middle of the night to check changes.  I