Activating applications

  • Is there a Cocoa equivalent to AppleScript's "tell application
    "whatever" to activate" that brings all of an application's windows
    forward? Using -[NSWorkspace launchApplication:] will activate the
    application but only bring its frontmost window forward in the
    overall window stack.

    --
    mikey
  • On Jan 12, 2007, at 1:11 PM, Michael Watson wrote:

    > Is there a Cocoa equivalent to AppleScript's "tell application
    > "whatever" to activate" that brings all of an application's windows
    > forward?

    Not that I know of, but you could use NSAppleScript to do that, or
    make & send the event manually.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • Yeah, I'm looking into AEBuildAppleEvent and AESend now, but for this
    task, I don't seem to gain anything over just using AppleScript.
    (Except that I drop the abstraction of AppleScript and NSAppleScript,
    which is tempting.)

    C'est la vie.

    --
    mikey

    On 12 Jan, 2007, at 15:40, Nick Zitzmann wrote:

    >
    > On Jan 12, 2007, at 1:11 PM, Michael Watson wrote:
    >
    >> Is there a Cocoa equivalent to AppleScript's "tell application
    >> "whatever" to activate" that brings all of an application's
    >> windows forward?
    >
    > Not that I know of, but you could use NSAppleScript to do that, or
    > make & send the event manually.
    >
    > Nick Zitzmann
    > <http://www.chronosnet.com/>
    >
    >
    >
    >
  • On 2007-01-12 15:11, Michael Watson said:

    > Is there a Cocoa equivalent to AppleScript's "tell application
    > "whatever" to activate" that brings all of an application's windows
    > forward? Using -[NSWorkspace launchApplication:] will activate the
    > application but only bring its frontmost window forward in the
    > overall window stack.

    To bring your own app to the front you can use NSApplication's
    activateIgnoringOtherApps.

    To bring an arbitrary app to the front you can use the Carbon function
    SetFrontProcessWithOptions().  Look through Processes.h for how to get
    an app's PSN.

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
previous month january 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today