• 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
launchd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

launchd


  • Subject: launchd
  • From: Adam Bell <email@hidden>
  • Date: Tue, 15 Aug 2006 11:07:00 -0300

Title: launchd
I've been 'playing' with launchd (Tiger's upgrade of CRON) after reading the cover article in MacScripter.net. launchd runs user daemons that are created from a plist located in ~/Library/LaunchAgents/. These are, in turn, launched by launchctl. Among launchd's plist keys (see man launchd.plist - a not at all obvious place to look) are these two:

StartInterval<integer>
This optional key causes the job to be started every N seconds. If the system is asleep, the job will be started
the next time the computer wakes up. If multiple intervals transpire before the computer is woken, those
events will be coalesced into one event upon wakefrom sleep.

WatchPaths <array of strings>
This optional key causes the job to be started if anyone of the listed paths are modified.

I'm not sure if those options make sense together.

Clearly, the first of these is an analog of a stay-open 'on idle' application included in the user's Account/Login Items, and the second is reminiscent of a Folder Action, except that it can also point to a file. I haven't yet tested the extent of its capacity to recognize that a file has been 'modified'. Does this include size or modification date?

Does anyone know if AppleScript v 1.10.7 actually uses launchd daemons for 'on idle' and 'Folder Actions' or are the launchd versions actually a more powerful and basic alternative? Launchd plists are relatively straight-forward to construct and launch with do shell script commands (with no permission issues since they're in the user's Library folder) so this is an interesting alternative that is possibly more robust than Folder Actions, for example, and is invisible to the user, unlike a normal 'on idle' handler's application. Interesting possibilities abound, and I'd be interested to hear what others are using launchd + AppleScript for.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Regular expressions help request: source file of disk image volume (From: "Laine Lee" <email@hidden>)
 >Re: Regular expressions help request: source file of disk image volume (From: Gnarlodious <email@hidden>)

  • Prev by Date: Changing White to Yellow on a pixel by pixel basis
  • Next by Date: Re: Changing White to Yellow on a pixel by pixel basis
  • Previous by thread: Re: Regular expressions help request: source file of disk image volume
  • Next by thread: Re: Regular expressions help request: source file of disk image volume
  • Index(es):
    • Date
    • Thread