Posted on 07-22-2021 08:19 AM
Hi,
I'm having trouble getting this script working. It test successfully when running the script locally on my machine, but when run through the JSS the change default location isn't working, screenshots still go to Desktop, and the script throws no errors.
Any suggestions?
#!/bin/sh
loggedInUser=$( ls -l /dev/console | awk '{print $3}' )
sudo -u $loggedInUser defaults write com.apple.screencapture location ~/Downloads
mv /Users/$loggedInUser/Desktop/Screen* /Users/$loggedInUser/Downloads
Solved! Go to Solution.
Posted on 07-22-2021 08:30 AM
Try using the full path when writing to com.apple.screencapture.
sudo -u $loggedInUser defaults write com.apple.screencapture location /Users/$loggedInUser/Downloads
Posted on 07-22-2021 08:30 AM
Try using the full path when writing to com.apple.screencapture.
sudo -u $loggedInUser defaults write com.apple.screencapture location /Users/$loggedInUser/Downloads