• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?


  • Subject: Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 09 Sep 2010 09:12:40 +1000
  • Thread-topic: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

On 9/9/10 8:13 AM, "Dave Keck" <email@hidden> wrote:

>> No, this is not correct. You can compile a script without launching
>> the target - at least on Snow Leopard.
>
> I'm afraid my testing shows otherwise; on my system, the following
> code always launches Safari on both 10.5 and 10.6:
>
>     [[[[NSAppleScript alloc] initWithSource: @"tell application id
> \"com.apple.Safari\" to activate"] autorelease] compileAndReturnError:
> nil];
>
> (Note it's -compileAndReturnError:, not executeAndReturnError:.) The
> launching behavior seems to vary by application, though. For me, this
> code launches iSync, Safari and System Preferences, but doesn't seem
> to launch iTunes.
>
> Such unpredictability is the nature of AppleScript

It's only unpredictable if you don't look for the reason.

It's a consequence of the fact that compilation requires an app's scripting
dictionary. For some apps the dictionary is fixed, but for others (for
example, those that support plug-ins) it can vary, in which case launching
the app is unavoidable.

--
Shane Stanley <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

References: 
 >Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6? (From: Dave Keck <email@hidden>)

  • Prev by Date: Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?
  • Next by Date: some no-op animation options?
  • Previous by thread: Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?
  • Next by thread: Re: Cocoa-dev Digest, Vol 7, Issue 890
  • Index(es):
    • Date
    • Thread