opening files created by my app

Thierry Arbellot thierry.arbellot at wanadoo.fr
Thu Jun 30 17:01:08 EDT 2005


Hi Christian,

When you double-click on the file, an apple event is send to the app
You just have to process this apple event.

hereafter is some code sample:

on appleEvent pClass, pID, pSender

   switch pClass & pID
   case "aevtodoc"  -- extract the path to the file to open
     request appleEvent data
     put it into theFilename  -- this is the file to read
     -- put here your code to read the file
     break
   default
     pass appleEvent
   end switch

end appleEvent

Hope it helps

Thierry

On 2005, Jun 30, , at 21:37, Langers Christian wrote:


>
> Hello everybody,
>
> how do I do to have my app read it's own created data upon startup ?
> e.g. when double-clicking a text file, the text is loaded into the
> Textedit (on Mac)...
>
> I manage to link the created file to open my app, but not to read its
> content...
>
> So, if anybody could give me a hint...
>
>
>
> Thanks,
>
>
> Christian





More information about the use-livecode mailing list