Morning all. I have what I feel should be a simplistic request that's troubling me.
I'm running a Launch Daemon (that ultimately runs as root, as all launch daemons do) that calls an applescript. That's running fine.
The applescript, at some point, may need to launch an app. These are the methods tried:
tell application "VerifyAndChangePassword" to launch
this fails with: /usr/bin/myscript.scpt: execution error: An error of type -10810 has occurred. (-10810)
do shell script "open -a /Applications/myapp.app"
fails with: /usr/bin/com.bob.myscript.scpt: execution error: LSOpenURLsWithRole() failed for the application /Applications/VerifyAndChangePassword.app with error -10810. (1)
any ideas? I may have to write a launch agent that monitors a plist and launches the app from there instead!