Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jottle

macrumors 6502
Original poster
Oct 17, 2003
402
5
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
 
Well. This is weird. This is what fixed it "xattr -rc". What did that do?
 
Well. This is weird. This is what fixed it "xattr -rc". What did that do?

Clear everything in the entire Desktop directory recursively, I would think according to the man page...

Code:
MacUser2525:~$ man xattr



XATTR(1)                  BSD General Commands Manual                 XATTR(1)





NAME


     xattr -- display and manipulate extended attributes

snip....


In the fifth form, with the -c option (``clear''), causes all attributes (including


     their associated values), to be removed.




...snip
-r  If a file argument is a directory, act as if the entire contents of the directory


         recursively were also specified (so that every file in the directory tree is


         acted upon).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.