Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
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?
 

mduser63

macrumors 68040
Nov 9, 2004
3,042
31
Salt Lake City, UT
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.
 

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
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.
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)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.