I was lurking in the "show of your self service" thread the other day and saw that user @rlandgraf had a policy that could show and hide hidden files. I thought this was genius and figured I'd create a similar policy by writing two scripts:
#!/bin/sh
defaults write com.apple.finder AppleShowAllFiles true
killall Finder
#!/bin/sh
defaults write com.apple.finder AppleShowAllFiles false
killall Finder
I dropped these into a /Library/Application Support/JAMF/Scripts and tried to call them with a command in self service. For some reason I can't get this to work and I've been at it for ... to long now, it's starting to get embarrassing. Maybe there's someone here that can figure out what I'm doing wrong. What it does is that it restarts the Finder but the files remain hidden but if I run the scripts through terminal they work just fine.
I've tried changing owner and permissions and I thought I got it to work by using #!/bin/bash instead of sh but that didn't work either.
