Re: Opening an external file in a external application
Re: Opening an external file in a external application
- Subject: Re: Opening an external file in a external application
- From: Nate Weaver <email@hidden>
- Date: Thu, 14 Aug 2008 15:05:02 -0500
- (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 (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden