• 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: Apple Events in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple Events in Cocoa


  • Subject: Re: Apple Events in Cocoa
  • From: Pascal Pochet <email@hidden>
  • Date: Wed, 22 May 2002 18:32:25 +0200

Hi

I want to talk to Microsoft Excel from my own Cocoa app.

I can get Excel9s AppleScript interface, classes and events, which I believe
tells me the Apple Events Excel supports. How do I convert these classes and
events into things I can send programmatically from my own app?

So far I9ve resorted to having my code write an AppleScript and run it, but
I9m sure there must be a nicer way, and I9m sure it must be obvious, but...

Thanks

Duncan Bushell

Some times ago I have developed a small tool to help build apple events to drive any application with has an aete resource in it.
The principle is simple: based on the use of AEBuild in the "driving" application, since getting the right string for AEBuild is not always easy, I do the following:
copy the aete resource in a small app (AESniffer) I have written
drive this application from ScriptEditor by sending the commands I want to use with the real application
of course AESniffer doesn't do what the original application (in your case Excel) is supposed to do but instead sends back to ScriptEditor the string generated by calling AEPrint on the received AppleEvent.
You have to save every strings sent back to later use in your real application.
So now the point for your question is that you will have to do extra work to use AEBuild from inside a Cocoa application since it's a Carbon call - it should be possible (they are examples on ADC on how do call Carbon from Cocoa) but I never try this particular one.

Pascal

http://users.skynet.be/p3consulting/downloads/mac/aesniffer.sit
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Apple Events in Cocoa (From: Duncan Bushell <email@hidden>)

  • Prev by Date: keybinding and getting keyDown for entire app
  • Next by Date: validateMenuItem: issues
  • Previous by thread: Apple Events in Cocoa
  • Next by thread: Re: Apple Events in Cocoa
  • Index(es):
    • Date
    • Thread