Making a Cocoa App which Receives, Analyzes and Replies to Email?

Discussion in 'Mac Programming' started by DavidCar, Nov 6, 2006.

  1. DavidCar macrumors 6502a

    Joined:
    Jan 19, 2004
    #1
    How can I make a Cocoa App that can receive, analyze, and reply to email?

    I've never used AppleScript, but it appears I can control the OSX Mail.app with it to receive and send email. So then the problem becomes one of using objective C to send AppleScript commands to the Mail.app to check for and obtain the email. Then my Cocoa App can analyze the message and create a reply, then send that reply via Mail.app with other AppleScript commands.

    I can find a reference for making Cocoa Apps scriptable, but not yet for making a Cocoa App that can control a scriptable app.

    Any pointers?
     
  2. mduser63 macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #2
    Normally I hate short replies that just point to the documentation, but really it's not too hard to figure out. You need to use NSAppleScript.

    http://developer.apple.com/document...ference.html#//apple_ref/occ/cl/NSAppleScript
    http://www.cocoadev.com/index.pl?NSAppleScript

    FWIW, I wanted to add a small feature that involved Mail to my Cocoa app and it took me about 45 m inutes to go from not knowing anything about NSAppleScript to having the feature fully working including debug and test. It's pretty easy to use.
     
  3. DavidCar thread starter macrumors 6502a

    Joined:
    Jan 19, 2004
    #3
    Sounds encouraging. I'll have to try playing with it to see if I can receive an email.

    Thanks,
    DC (from a 20" C2D iMac in Orem, UT)
     
  4. mduser63 macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #4
    Nice to see another Utahn on MacRumors. There are a few of us here.
     

Share This Page