• 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: Sending AppleEvent ansr
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending AppleEvent ansr


  • Subject: Re: Sending AppleEvent ansr
  • From: has <email@hidden>
  • Date: Wed, 24 Oct 2007 19:11:30 +0100

Ivan C Myrvold wrote:

I am porting an application, Tansa, from Carbon to Cocoa.
The application communicates with another application (InCopy) via
AppleEvents.
When running my application from Xcode, everything works fine, but
running it from Finder, the other application hangs.
I have traced the AppleEvents in Terminal, and the difference is that
I do not get the second event (aevt/ansr) when running my Cocoa
application. Do I have to do anything in the Cocoa application to
send this AppleEvent back to the other application?

Sounds like there's a bit of confusion here as to how Apple events work. To clarify: aevtansr is the reply event sent by the target application back to yours when you pass the kAEWaitReply/ kAEQueueReply flag to AESend[Message](). It's what you unpack to extract the target application's result or error value, not something that client programs should send themselves.


...

Anyway, if you're rewriting your existing Carbon-based Apple event code using ObjC+Cocoa, I'd recommend taking a look at objc-appscript which provides a high-level, easy-to-use ObjC wrapper around the Apple Event Manager:

	http://appscript.sourceforge.net/objc-appscript


OTOH, if you're reusing your existing Apple event code largely as-is, I'd suggest posting a testable sample section to the AppleScript- implementors list [1] and perhaps folks there can spot what the problem is.


HTH

has

[1] In theory you should ask on AppleScript-users since it's a client- side question, but experienced developers who can best answer C/ObjC- related questions tend to be on AppleScript-implementors so I'd ask there.
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org


_______________________________________________

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: crash in using soundNamed:
  • Next by Date: Re: crash in using soundNamed:
  • Previous by thread: Re: Sending AppleEvent ansr
  • Next by thread: Re: Sending AppleEvent ansr
  • Index(es):
    • Date
    • Thread