• 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: Test for launched from (Apple)Script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for launched from (Apple)Script?


  • Subject: Re: Test for launched from (Apple)Script?
  • From: Matt Neuburg <email@hidden>
  • Date: Wed, 10 Nov 2010 13:32:36 -0800

On Wed, 10 Nov 2010 13:34:09 -0500, "McLaughlin, Michael P." <email@hidden> said:
>Is there any standard way for a Cocoa app to test whether it was launched
>from a script, esp. AppleScript?

All apps are launched the same way - by sending them an oapp Apple event (or similar). It doesn't matter whether it came from the Finder (double-clicking the app) or a script; an Apple event is an Apple event. That's the whole point of Apple events; they are a universal system level messaging system.

If the question is "Who is sending me this oapp Apple event?", I don't think there's any way to find that out because in a Cocoa app by the time your code runs that's already happened.

m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________

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

  • Prev by Date: Re: Cocoa-dev Digest, Vol 7, Issue 1044
  • Next by Date: NSTableView within NSScrollView in code
  • Previous by thread: Re: Test for launched from (Apple)Script?
  • Next by thread: RE: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error
  • Index(es):
    • Date
    • Thread