appleEvents ?

Jan Schenkel janschenkel at yahoo.com
Sun Dec 7 04:14:46 EST 2003


--- Mark Brownell <gizmotron at earthlink.net> wrote:
> What happened to this in the docs?
> "Recipe for processing files opened in a Mac OS or
> OS X application"
> 
> I'm trying to double-click on an MTML document that
> will run my 
> standalone MTML app and load that document. I'm
> looking for the code to 
> enter in a "on preOpenStack" or "on startUp" handler
> located in my 
> standalone app.
> 
> any ideas?
> 
> Mark
> 
> 

Hi Mark,

Check out the 'appleEvent' message in the Transcript
Dictionary. If my memory serves me well, you will get
an appleEvent of class 'aevt' and id 'odoc'
Example script :
--
on appleEvent pClass, pID, pSender
  switch pClass & pID
  case "aevtodoc"
    # extract the path to the file to open
    request appleEvent data
    put it into tFilePath
    # now open the file and do your thing
    # ...
    break
  default
    pass appleEvent
  end switch
end appleEvent
--

I'm not sure how you're supposed to edit your plist
information so that the OS will automatically fire up
your app, though.

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


More information about the use-livecode mailing list