Re: WebKit+AppleScript+JavaScript
Re: WebKit+AppleScript+JavaScript
- Subject: Re: WebKit+AppleScript+JavaScript
- From: Jens Alfke <email@hidden>
- Date: Wed, 16 Apr 2008 07:43:39 -0700
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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