[comp.sys.mac.programmer] How do I write a Mac Daemon

mendozag@pur-ee.UUCP (Grado) (03/22/89)

   I need to write a program for Multifinder that sits in the
 background waiting for a file to be created by another application
 and then process that file and goes back to wait.
 (no windows or menus). How do you set a program for background only?

   Has anybody done anything similar? I'd love to see some sample
 code in LSC or MPW.

   Also, what other ways besides using _OpenDeskAcc can be used to
 switch between applications in Multifinder (programming).
   
   Thanks a BuNDLe in advance

    Victor

alexis@ccnysci.UUCP (Alexis Rosen) (03/27/89)

In article <11071@pur-ee.UUCP> mendozag@pur-ee.UUCP (Victor M Grado) writes:
>   I need to write a program for Multifinder that sits in the
> background waiting for a file to be created by another application
> and then process that file and goes back to wait.
> (no windows or menus). How do you set a program for background only?

Just open up your "SIZE" resource with a recent ResEdit (>=1.2b2, I
think).  You will see a yes/no option, "Only Background."  Set it to
true, along with the "Can Background" bit. That's it. MultiFinder will
launch it into the background, and it will not recieve any user events.
After it's launched, the launching application will continue to run.

If you have an earlier resedit, I think the "Only Background" bit is
right after the "Multifinder Aware" bit.

Take a look at Backgounder, which comes in all Multifinder system releases.

>   Also, what other ways besides using _OpenDeskAcc can be used to
> switch between applications in Multifinder (programming).

I'm not 100% sure about this, but I think that if you try to launch an already-
open application, it will switch instead. I haven't tried this myself, though.

Alexis Rosen
alexis@ccnysci.uucp