- (BOOL)openURLs:(NSArray *)urls withAppBundleIdentifier:(NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)optionsadditionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifiers:(NSArray **)identifiers

Long method name, but you can pass in NSWorkspaceLaunchWithoutActivation as one of the options to avoid having the app come to the foreground (10.3+).

On Aug 14, 2008, at 2:54 PM, John Love wrote:


workSpace = [NSWorkspace sharedWorkspace];
success = [workSpace openURL:absoluteURL];

activates Excel .. what do I need to add to re-activate my Cocoa app .. "activate me" was terribly easy with AppleScript.

NSApplication has methods to active your application.


found it ... thanks!

[NSApp activateIgnoringOtherApps:YES];

... now back to (1,2,3) above

John Love
Touch the Future! Teach!



Whoops ... almost ... activateIgnoringOtherApps momentarily activates my cocoa app. However, the application, Excel, keeps activating itself until it is the front application.

So, I guess what I really need is a technique to determine when the app, Excel, is completely finished coming to the front and then calling activateIgnoringOtherApps.

I really don't know how to do this because this "smells" of having to interrupt Cocoa's main event loop and that is a definite no-no.

Maybe its a matter of asking Excel to notify "me" when it completes its startup. NSNotification??





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/nateweaver%40xtechllc.com

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to