I want to give the user the option to report a bug by sending a mail with a logfile attached from a plugin.
I am using juce::Process::openEmailWithAttachments
It works fine for example in Ableton, but not in Logic. I debugged the system call and the AppleScript within openMailWithAttachment fails with:
“Mail got an error: A privilege violation occurred.”
Does anyone know how to solve this?
Logic probably do not have the entitlement to open en email application.
I’m afraid you cannot fix that.
I don’t know much about Logic X.
But as a workaround: If you have a server of your own, you could create an API on that server, which sends an email. And your plugin could talk to your server in order to send the email. (That’s how we are doing it. Not for log files though, but for retrieving forgotten login keys).
Oh, thats a pity :-/
Thank you for the answer and the workaround!
Maybe launch a python script from a short lived thread that reads or writes the email and prints it to an XML?
(You would have to install python on users machines though, or have python 3.7 in your application data)
If you insist on using the default email client,
Within your plug-in bundle (Plugin.Component/Resources/openemail) might work.
And make a simple console app
openemail binary that what you want and has its own entitlements.
Just keep in mind not all people has an email client. (as for myself, the Mail app isn’t configured and I use web-based services on desktop).