On 16 Apr '08, at 5:16 AM, Praveen Kumar wrote:
Instead of AppleScript, I tend to use NSTask to launch the application, but it won't use the active application instead it opens another one and do the stuff.
Launching GUI apps via low-level Unix system calls (as NSTask does) can be problematic. CoreServices, which keeps track of application processes, either isn't aware of those, or is but treats them differently; I'm not sure which. I do know that the "only one copy of an app can be running at once" rule only applies to apps launched by LaunchServices; so if you start one yourself via exec or NSTask, and then something goes through the normal launch mechanism (in this case AppleScript), a second copy will be launched.
It would be better if you used NSWorkspace to launch your app. Or for more control, you can call LaunchServices directly.
—Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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]