Using openEmailWithAttachments sometimes new email window isn't visible


I’m using Process::openEmailWithAttachments to open a new email as a way for our users to send us a bug report. The problem is, sometimes the new email window doesn’t pop up, but stays hidden until the Email client is clicked and brought to the front. Is there a way to force the new email window to pop to the front right away?

Well obviously this is OS dependent, and probably not something that could be fixed… Which OS are you talking about?

I’m talking about OS X El Capitan. I should have mentioned that. On Windows I’m using openDocument with a mailto-link, but that didn’t seem to work in OS X.

Well, AFAIK there’s no way to force the OS to bring another app to the front, especially when your app has no control at all over how the OS chooses to “send an email”. You might want to do some digging into the low-level functions that trigger the email, but I don’t think there’s much that could be done.