Reputation: 33
I have been trying to send a Cocoa Lumberjack log file through email from within my Mac OSX application, using apple script. Is it possible to do this?
I have a problem with being able to use applescript to get the attachment out of the correct folder, I am able to create and send a message just fine without attachment.
I noticed that there are only really entitlements for accessing the users downloads, pictures, movies, music folder which aren't very convenient to store log files in.
Upvotes: 2
Views: 660
Reputation: 2563
Can you get the latest log in objective-c, temporarily write it to an accessible location (e.g. Downloads) and attach to email from there via AppleScript?
NSArray *logFilePathsArray=[[myFileLogger logFileManager] sortedLogFilePaths];
NSString *myLogFilePath=[logFilePathsArray firstObject];
// ... Copy to Downloads folder URL
Upvotes: 1