I\'ve got a background process that makes a transparent window appear when a hotkey is pressed:
[window makeKeyAndOrderFront:nil];
[[content animator] setAlp
For 10.6 or greater
[[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
Look at [[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
.
Swift 4.2+ of @Arvin answer
NSRunningApplication.current.activate(options: [.activateIgnoringOtherApps, .activateAllWindows])