Skip to main content
Question

Script failing from Self Service

  • November 30, 2010
  • 1 reply
  • 12 views

I have a one line script;

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile";}' && killall Dock

…which puts a stack on the Dock that houses Recent Applications.

This runs fine when run locally on the machine as a standard user with/without Admin rights.

However, if this runs from a Self Service policy it fails to add the stack – the respawn of the Dock goes through fine, but the stack never appears.

Any thoughts?

Cheers

Rhys

1 reply

bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • November 30, 2010

You'll need to grab the currently logged in user from console & then pass..

User=/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'

/usr/bin/defaults write "$User"/Library/Preferences/com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile";}' && killall Dock

Regards,
Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883