Refresh Self Service via Files and Processes Payload Execute Command

Valued Contributor II


While adding opt-in and opt-out Self Service policies to Jamf Pro 10, we wanted a way to force Self Service to refresh so new testers would immediately see available testing policies.


Add the Files and Processes Payload to your policy, then insert the following code into the Execute Command field:

/usr/bin/su - "`/usr/bin/stat -f%Su /dev/console`" -c "/usr/bin/osascript -e 'tell application "Self Service" to activate' -e 'tell application "System Events" to keystroke "r" using {command down}'"


Self Service should refesh after the policy is executed. (As always, your mileage may vary.)

Related Posts

@rhs615's Command to Refresh Self-Service

@timdambrosio's Self Service refresh/home via command line



Great tip! Definitely see uses for this. Thank you.

New Contributor III

Just used this, thanks.

Modified it as follows for forcing the user to view the description, adding in an Esc key press before the refresh:

/usr/bin/su - "`/usr/bin/stat -f%Su /dev/console`" -c "/usr/bin/osascript -e 'tell application "Self Service" to activate' -e 'tell application "System Events" to key code 53' -e 'tell application "System Events" to keystroke "r" using {command down}'"

New Contributor II

I made a silly mistake and spent some time trying to figure it out. For the next person that does the same here is my ah-hah moment which is admittedly a "well ya, duh" kind of thing.

If you opted to rebrand Self Service especially the name of the application not just the icon. You will need to change the "Self Service" in the command to "Whatever you renamed Self Service to"... I had added our school districts initials to Self Service in addition to changing the icon to the school logo to make it as familiar as possible.

Valued Contributor II

Thanks for your racing-stripe, @kfbbt.

You'll also need the following Privacy Preferences Policy Control settings nowadays:

  • Identifier:
  • Identifier Type: Bundle ID
  • Code Requirement: anchor apple generic and identifier "" and (certificate leaf[field.1.2.840.113635.] / exists / or certificate 1[field.1.2.840.113635.] / exists / and certificate leaf[field.1.2.840.113635.] / exists / and certificate leaf[subject.OU] = "483DWKW443")
  • App or Service: Accessibility
  • Access: Allow


New Contributor

Has anyone managed to get this to work on Monterey? I am getting the following error, and unfortunately I can't see how to fix it or what causes it "exactly"..

zsh:1: unmatched '

Valued Contributor II

@Googolplex The following just worked for me in a single test on macOS 12.0.1 (21A559).

/usr/bin/su \- "`/usr/bin/stat -f%Su /dev/console`" -c "/usr/bin/osascript -e 'tell application \"Self Service\" to activate' -e 'tell application \"System Events\" to key code 53' -e 'tell application \"System Events\" to keystroke \"r\" using {command down}'"