Mailing data back home

Member
Posts: 31
Joined: 2004.09
Post: #1
Hi all,

OK, not specifically a game related thing, but...

My carbon app has a log file. When Things Go Wrongâ„¢ on my tester's and customer's machines, I need to see this log file.

what options do I have with getting this log file by mail? (I don't want to send data surreptitiously.) Ideally, I'd like to have a new mail document generated, with email address pointing to my support emal address, subject line, and either the log file attached, or just plain text inserted in the mail document, all ready for the user to hit the Send button.

Doable?

thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
easily doable with applescript.
Quote this message in a reply
Member
Posts: 31
Joined: 2004.09
Post: #3
Through carbon?

Please elaborate? Thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
You can make applescript calls through carbon, but I've never tried it. I've successfully used the "osascript" command-line utility to do precisely what you want, though. You can always call out to that with system() if your app is Mach-O.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #5
Cocoa Soultion
#import <Message/NSMailDelivery.h>

[NSMailDelivery deliverMessage: msgText subject: msgSubj to: msgDest];

This will send a email from the users default mail address. It will automaticly compose and send but will prompt the user to authorize your app to access the keychain for the mail password. Hope this helps

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Member
Posts: 116
Joined: 2002.04
Post: #6
You can do it through carbon, either with the osascript solution OSC mentions, or by writing the code to send an AppleEvent.

Wade
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post: #7
look at apple website there is an exemple of how to execute applescript using carbon
and there is a script in this exemple how to send an email too
Quote this message in a reply
Member
Posts: 31
Joined: 2004.09
Post: #8
Excellent! Thanks for all the help -- I'll try the Applescript through Carbon route for now.

ta.
Quote this message in a reply
Apprentice
Posts: 14
Joined: 2004.07
Post: #9
AFAIK, with AppleScript you'll need to write a different script for each particular email client. The AppleScriptRunner sample code shows ones for Entourage and Mail, which probably covers most users, but it necessitates asking the user which email client they use, which is a bit of a pain. Still, I guess it's better than my current method of asking the user to do all the work of emailing the error file to me.

You might consider having the program upload the log file to your web or ftp site, which would cut out all the middle-men. I hear it's pretty easy to do, although I haven't personally tried it yet. I've had others direct me to libcurl, which seems like it might be just the thing.

Of course, you'd still need to ask permission to send the file, just in case they have Little Snitch running or something Smile

Take aquadot!red out for a spin
It sure ain't your grandpa's pacman!
www.angelFrogGames.com
Quote this message in a reply
Member
Posts: 31
Joined: 2004.09
Post: #10
Good point. I noticed that you have to choose which application specifically. Argh, it's never easy is it.. Wink

I'm trying to add the Applescripts to my bundle's Resource directory. I need to have them in an Applescripts folder (or at least some folder). Yet when I try to add the folder to Xcode, the folder is not copied in my bundle, only the scripts themselves. Is there a way to make Xcode include the folder?

thanks again.
Quote this message in a reply
Post Reply