Skip to main content
Solved

Change Screenshot Location Script Help

  • July 22, 2021
  • 1 reply
  • 1 view

Forum|alt.badge.img+7

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

 

Best answer by skeenan07

Try using the full path when writing to com.apple.screencapture. 

 

sudo -u $loggedInUser defaults write com.apple.screencapture location /Users/$loggedInUser/Downloads
View original
Did this topic help you find an answer to your question?

1 reply

skeenan07
Forum|alt.badge.img+10
  • Contributor
  • 34 replies
  • Answer
  • July 22, 2021

Try using the full path when writing to com.apple.screencapture. 

 

sudo -u $loggedInUser defaults write com.apple.screencapture location /Users/$loggedInUser/Downloads

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings