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: "S. J. Cunningham" <email@hidden>
- Date: Fri, 02 Oct 2015 15:16:17 -0400
Thanks, Chris.
As I understand it the only difference (other than philosophical) between a Daemon and a Agent is that the Daemon goes in a System folder and an Agent goes in the user's folder. I have written several such Agents for testing and they work fine in all other respects. However UI interactions such as "display dialog" appear not to be executed: no dialog appears and the Agent doesn't appear to be waiting for a response. What am I missing?
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
On Oct 2, 2015, at 2:57 PM, Christopher Nebel wrote:
>> 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
_______________________________________________
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