Hey guys, I am having difficulty opening the Mail app and sending a message. I have it to the point where it opens the app, opens the new message dialog, puts in the Subject, and the Body, but when there is a space in the body, it doesnt do anything. Here is code:
This will work without a problem. But say I change:
to this:
It will not work. Is there any way to do this ?
I was thinking maybe there is a way to do this with AppleScript and have it not even open the mail program, but I am not sure how to do this.
Code:
NSString *emailMail = @"mailto:?subject=mySubject&body=";
NSString *emailURL = [testU stringValue];
NSString *emailSIG = @"Sig";
NSString *URLFinal = [NSString stringWithFormat:@"%@%@%@", emailMail, emailURL, emailSIG];
NSLog(@"%@",URLFinal);
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:george1]];
This will work without a problem. But say I change:
Code:
NSString *URLFinal = [NSString stringWithFormat:@"%@%@%@", emailMail, emailURL, emailSIG];
Code:
NSString *URLFinal = [NSString stringWithFormat:@"%@%@\n%@", emailMail, emailURL, emailSIG];
It will not work. Is there any way to do this ?
I was thinking maybe there is a way to do this with AppleScript and have it not even open the mail program, but I am not sure how to do this.