I am trying to execute an Apple Script from my launchd daemon. My script has just one line and it is given below.
say "Message From Daemon!"
This always fails and throws this error message "File some object wasn't found".
Any idea why this is happening? The same script works properly if I run from xcode (not launching it via launchd) and from any other app that runs in user context.
Playing sound using NSSound
rely on the window server
and daemon is not allowed to connect to the window server.
I am assuming same issue with say
command. ( This tool uses the Speech Synthesis manager to convert input text to audible speech and either play it through the sound output device chosen in System
Preferences or save it to an AIFF file.)