Skip to main content
Question

Terminal wants access to control System Events.

  • June 5, 2023
  • 2 replies
  • 109 views

Forum|alt.badge.img+6

 

Hello,

I need to prompt users with "osascript"
even admin rights granted, popup not showing up on some macs only !!!

instead, they got this:
Any idea please?

2 replies

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • June 5, 2023

@Eskobar That implies that for Macs which are not displaying that prompt you have previously deployed a Configuration Profile with a  PPPC profile granting access to System Events. Look at your Configuration Profiles for one with that PPPC profile and see why it's not being deployed to the Macs where that prompt is appearing


Bol
Forum|alt.badge.img+11
  • Contributor
  • June 5, 2023

@Eskobar 
There's no need for a 'Tell' block when using the apple script command 'display dialog' so remove that.

Also osacript doesn't need to send a command to another process (system events) which causes the privacy prompt, remove that too. 

Lastly running osascript in the user context is enough, unless you are doing more than just a dialog box you can remove adding them to admin group.

So it would look like;

sudo -u $user /usr/bin/osascript -e "display dialog....." etc.

Good luck!