I am needing to remove some obsolete login items from our classroom machines
I'm trying the following
#!/bin/bash -v
exec 2>&1
sudo -u $3 /usr/bin/osascript -e 'tell application "System Events" to delete login item "PCClient"'
sudo -u $3 /usr/bin/osascript -e 'tell application "System Events" to delete login item "fthf02.op.ac.nz"'
It works fine running it manually on a client but once I run it as a login policy I get
Script result:
sudo -u $3 /usr/bin/osascript -e 'tell application "System Events" to delete login item "PCClient"'
43:53: syntax error: A class name can’t go after this identifier. (-2740)
sudo -u $3 /usr/bin/osascript -e 'tell application "System Events" to delete login item "fthf02.op.ac.nz"'
43:53: syntax error: A class name can’t go after this identifier. (-2740)
Any ideas what I'm doing wrong?