views:

241

answers:

0

I have made a short applescript that sends an email with an attached vcs-file. 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];

Interesting is that the mail is created and sent, but the attachment isn't attached. Running the applescript solely in scripteditor works fine though. Any ideas?

Thanks