Hi all,
I'm working on a script that will pop up a dialog using the standard AppleScript dialog box to the user to prompt for installing software updates. This script works perfectly fine if run locally (sudo ./SUSUpdate.sh) or if I run it using a custom trigger (sudo jamf policy -trigger SUSUpdate).
But when it runs in a recurring check-in trigger, the dialog box fails to display and an AppleScript error is thrown.
Here's the section of the script that's throwing the error:
prompt=`sudo osascript << EOT
tell app "System Events"
Activate
display dialog "A critical update for your computer - $ForceUpdateRequired - addresses a significant security vulnerability and needs to be installed. Do you want to install it now?" with title "Software Update Required" buttons {"Not Now", "Install"} default button 1 with icon file "Library:Application Support:JAMF:bin:SoftwareUpdate.icns"
end tell
EOT`
$ForceUpdateRequired was set earlier in the script to be the name of the forced software update, and I also have another section of the script that copies in the SoftwareUpdate.icns file into the path /Library/Application Support/JAMF/bin/
When it gets to that section of the script, here's the log on the JSS:
32:40: execution error: An error of type -10810 has occurred. (-10810)
I can't find a reference of that error anywhere, and there must be something in that one line of code to display the dialog that's causing the problem.
Does anyone have an idea what might be going on?
Thanks,
Jason