So I have this weird problem. I use a script that applies a simple and reversible terminal command to hide and show my desktop icons from time to time. This has worked flawlessly always. However, for some reason, the last time I ran the script it no longer changed the file attributes for my desktop files correctly, and now no matter what I do my desktop files remain characterized in the finder as hidden. I've mucked around with a bunch of the same terminal commands to fix this, but no matter what I do the desktop files keep their hidden attribute in the finder. It's super frustrating. Is there a way for me to check why these files are staying hidden even though I've been unhiding them?
I've tried these terminal commands to no avail (including the ones in the script below):
"sudo chflags nohidden /path/to/file"
"sudo xattr -c /path/to/file"
Here's the script I was using:
display dialog "Desktop icons visible or hidden?" buttons {"Visible", "Hidden"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "Hidden" then
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
else
do shell script "defaults delete com.apple.finder CreateDesktop;killall Finder"
end if
I've tried these terminal commands to no avail (including the ones in the script below):
"sudo chflags nohidden /path/to/file"
"sudo xattr -c /path/to/file"
Here's the script I was using:
display dialog "Desktop icons visible or hidden?" buttons {"Visible", "Hidden"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "Hidden" then
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
else
do shell script "defaults delete com.apple.finder CreateDesktop;killall Finder"
end if