If you call
NSRunAlertPanel()
from a background process in Cocoa, the dialogue does not come to the front and instead stays behind other windows. This post shows that you can bring the dialogue to the front if you convert the process to a foreground process. If you keep the process a background process, however, is there any way to achieve this behavior?