Вопрос

I know that I can open the file information dialogue (Get Info) for several files at once using ⌘⌥I and hide/unhide file extensions. How do I accomplish this for all files in a directory tree (including files in subfolders)?

Это было полезно?

Решение 2

Ok, I found a solution using Hazel:

I created a rule based on their posting How to get Hazel to go into subfolders:

If (…) Kind is Folder

Do the following (…) run rules on folder contents

The next rule selects a certain set of files, e.g.

If (…) Kind is pdf

Do (…) Run AppleScript embedded script

The script is

tell application "Finder"
    set extension hidden of theFile to true
end tell

I defined more conditions more different file types, so it doesn’t work on all files as requested. With a limited number of different file types this should be no problem.

Другие советы

You can easily do this in Terminal with the SetFile command:

To hide file extensions in a directory and all sub-directories:

cd <path to directory>

find . -name "*.*" -exec SetFile -a -E '{}' \; | echo "hiding extensions"

(can change the second * to a particular extension type if you choose)

To show file extensions in a directory and all sub-directories:

cd <path to directory>

find . -name "*.*" -exec SetFile -a -e '{}' \; | echo "showing extensions"
Лицензировано под: CC-BY-SA с атрибуция
Не связан с apple.stackexchange
scroll top