Here’s an AppleScript to help you regain control of your user home folder if permissions have been corrupted by performing certain actions such as installing software that doesn’t respect proper home folder permissions or by drag copying items when the current context for maintaining proper permissions is incorrect. Symptoms of this problem can range from not being able to see on the desktop items that are known to exist in the Desktop folder or not being able to move icons for desktop items to being unable to copy or move items inside the home folder.
The current user account must be an admin account when the script is used. If the account needing repair is not currently an admin account, you can use the Users & Groups prefpane to make it an admin account temporarily to run the script (providing, of course, that you have access to an admin account).
set username to do shell script "id -un" do shell script "chown -R" & space & username & space & "~;chmod -RN ~;chmod -R o-w ~;chmod +a \"everyone deny delete\" ~/ ~/Desktop ~/Documents ~/Downloads ~/Library ~/Movies ~/Music ~/Pictures ~/Public ~/Sites;chmod +a \"" & username & space & "allow list,add_file,search,delete,add_subdirectory," & "delete_child,readattr,writeattr,readextattr," & "writeextattr,readsecurity,writesecurity,chown,file_inherit," & "directory_inherit\" ~/Public/Drop\\ Box" with administrator privileges