I have made a short applescript that sends an email with attachment. Now I want to integrate this script in my cocoa application. I have tried the following code that i found on the internet:
NSAppleScript *mailScript;
NSString *scriptString= [NSString stringWithFormat:@"the applescript"];
mailScript = [[NSAppleScript alloc] initWithSource:scriptString];
[mailScript executeAndReturnError:nil];
[mailScript release];
This code doesn't work however. I am a complete newbie at cocoa and could use some help.
UPDATE: The email is created. The applescript seems to stop when the attachment is added though.The applescript works perfectly when runned in scripteditor. Any clue?
Thanks