Re: How Can I Get a Launch Agent which is a Script to Talk to Me?
Re: How Can I Get a Launch Agent which is a Script to Talk to Me?
- Subject: Re: How Can I Get a Launch Agent which is a Script to Talk to Me?
- From: Christopher Nebel <email@hidden>
- Date: Fri, 02 Oct 2015 11:57:53 -0700
> On Sep 30, 2015, at 12:18 PM, S. J. Cunningham <email@hidden> wrote:
>
> I am writing an AppleScript to be launched periodically by launchd (yes, I'm back to working on my Dead Man Project for those of you who remember) and I find that "display dialog" messages disappear into the ether. I read somewhere that Daemons aren't supposed to communicate with losers, er, users so I assume the same applies to Launch Agents.
You assume incorrectly. In fact, that’s one of the key differences between daemons and agents: daemons run in the system context, independent of any user, and cannot have UI (not directly, anyway; there are tricks like using “say” or “display notification”); agents run in the user context, and may have UI. In general, you want an agent; daemons are really only appropriate when you’re managing something about the machine itself, usually hardware. Make it an agent, and it should be fine, although be careful of the difference between LSBackgroundOnly (no UI at all) and LSUIElement (no Dock icon and no menu bar).
—Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden