The error occurs because the commands in your osascript require a graphical user session. AppleScript requires a graphical user session to work.
The launchd job is running as the root user in a non-graphical user session.
The error occurs because the commands in your osascript require a graphical user session. AppleScript requires a graphical user session to work.
The launchd job is running as the root user in a non-graphical user session.