I want to run a bash script that uses osascript display dialog to prompt the current user for with 3 options. Base on the user's choice I want the script to call on custom triggers I have set for jamf policies. Unfortunately, it doesn't execute the jamf -event command without an admin password. I looked into jamfhelper yet I need 3 button option. Is there a different approach I can use or would I need change the script?
#!/bin/sh
/usr/bin/osascript <<-EndOfScript
tell application "Finder"
activate
display dialog "In order for the workflow to complete, please indicate who this device is being prepared for." buttons {"Red", "Blue", "Orange"} with icon stop with title "Important!"
if button returned of result = "Red" then
do shell script "/usr/local/bin/jamf policy -event redpolicy"
else
if button returned of result = "Blue" then
do shell script "/usr/local/bin/jamf policy -event redpolicy; /usr/local/bin/jamf policy -event bluepolicy"
else
if button returned of result = "Orange" then
do shell script "/usr/local/bin/jamf policy -event redpolicy; /usr/local/bin/jamf policy -event orangepolicy"
end if
end if
end if
end tell
EndOfScript
Thanks in advance.