SBElementArray *mailAttachments = [selectedMessage mailAttachments];
for(MailMailAttachment *mailmailAttachment in mailAttachments) {
NSLog(@"Name--->%@",[mailmailAttachment name]);
NSLog(@"attchment id--->%@",[mailmailAttachment id]);
NSLog(@"mailmailAttachment--->%@",mailmailAttachment);
NSString *fileNameWithBlank1 = [[mailmailAttachment name] stringByReplacingOccurrencesOfString😡" " withString😡"%20"];
NSURL* targetfileUrl = [NSURL URLWithString:[NSString stringWithFormat😡"file://localhost/Users/myname/Desktop/Build/%@",fileNameWithBlank1]];
NSLog(@"targetfileUrl--->%@",targetfileUrl);
[mailmailAttachment delete]; // delete attachments
[mailmailAttachment saveIn:targetfileUrl as:MailSaveableFileFormatNativeFormat];
}
hi Experts, I have code which is not working for delete message, It throwing some error code OSStatus error -10000 but the message "saveIn" is working fine ,Why it is so.AppleEvent is applied on Same objectType then why their is difference. Please help me to sort out this issue. 😕
for(MailMailAttachment *mailmailAttachment in mailAttachments) {
NSLog(@"Name--->%@",[mailmailAttachment name]);
NSLog(@"attchment id--->%@",[mailmailAttachment id]);
NSLog(@"mailmailAttachment--->%@",mailmailAttachment);
NSString *fileNameWithBlank1 = [[mailmailAttachment name] stringByReplacingOccurrencesOfString😡" " withString😡"%20"];
NSURL* targetfileUrl = [NSURL URLWithString:[NSString stringWithFormat😡"file://localhost/Users/myname/Desktop/Build/%@",fileNameWithBlank1]];
NSLog(@"targetfileUrl--->%@",targetfileUrl);
[mailmailAttachment delete]; // delete attachments
[mailmailAttachment saveIn:targetfileUrl as:MailSaveableFileFormatNativeFormat];
}
hi Experts, I have code which is not working for delete message, It throwing some error code OSStatus error -10000 but the message "saveIn" is working fine ,Why it is so.AppleEvent is applied on Same objectType then why their is difference. Please help me to sort out this issue. 😕