Help - Hidden files

I’ve no ideas how it has happened but a goodly portion of folders / files on my iCloud have become hidden files.
I know i can go through all the folders / files and reset them using terminal and 'chflags nohidden ’ but that will take way too long to do.

Is there any script I can run that can set the hidden flags back?

Help!

Don’t know if this script will also either show or hide files that are in iCloud, but thought I’d post it as I use it on a regular basis, but have never had my iCloud files become invisible.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

display dialog "Would you like to show hidden files?" buttons {"Show Hidden Files", "Hide Files"}

set result to button returned of result
if result is equal to "Show Hidden Files" then
	do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true"
else
	do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false"
end if
do shell script "killall Finder"

That does allow hidden file to be visible or not, but doesn’t change the flags.
However I’ve solved the issue (I think) by signing out / in to iCloud as that seems to have resolved the issue.

I don’t think “hidden” is a flag.

sudo xattr -r PATHTOFOLDER
(-r) is recursive

Read all xattr (extended attributes, such as a flag)

Example for removing quarantine

To remove the com.apple.quarantine extended attribute from the application, you should use the following command:

sudo xattr -r -d com.apple.quarantine /path/to/

sudo xattr -r -d com.apple.quarantine

By using this command you’re removing the com.apple.quarantine extended attribute from the application. The -r flag removes the attribute recursively from all files inside the application, and the -d flag indicates the given attribute is to be removed.

Sure I’ve used that before with applications. No good for this situation. It is resolved now anyway. .

Why. No good for this situation?

You said you have “flagging” issues.
Or was that not technically your problem.

The problem was not a quarantine issue but that the ‘hidden’ flag had been applied to the files over a lot of iCloud.

It’s actually a flag within Finder App prefs.and not with any files or folders. In the code posted above theew waa a Kill All Finder, also a Kill all needed to be applied to the iCloud “drive” as well as you experienced.

No flags on any files or folders

Right, one lives and learns theb :slight_smile: