How do I activate (bring to front) in RubyCocoa?

How can I bring my RubyCocoa application to the front? Basically, I want to get the same output as the applescript string:

tell application "Whatever" to activate

      

0


a source to share


2 answers


In Cocoa you add your application to NSApplication - activateIgnoringOtherApps: . Presumably you can make this call through the RubyCocoa bridge.



+3


a source


There are certain steps for this, and I'm sure you know what you are doing, but just keep in mind that if you use this inappropriately, Mac users will chase you with pitchforks and shotguns. Apps that steal focus while the user is busy doing something else don't actually fly on OS X.



+1


a source







All Articles