Hi, Applers.
I have taken note of a 2015 script published here on MR by w0lf (and will reference the like below) but wanted to tweak it; I am in need of a similar Terminal-script but more parochial.
I want only to hide all extensions in my Music folder (which is GB140 and peppered with mp3 and wma suffixes too great to engage on an item-by-item level) and cannot check/uncheck at the folder-level the CMD-i/CMD-ALT-i option for "Hide extension" no matter what I try.
Below is w0lf's HDD-universal script and I would like someone in the know to confirm it would work if I rewrite the line ...for item in $1... as ...for item in "€HOME"/Music...?
(NB Must locative elements of scripts be in English language or language that the MBP operates in? E.g. there are no folders called Documents, Pictures, Music et cetera on my computer)
**Begin w0lf's instruction**
Thanks, everyone.
I have taken note of a 2015 script published here on MR by w0lf (and will reference the like below) but wanted to tweak it; I am in need of a similar Terminal-script but more parochial.
I want only to hide all extensions in my Music folder (which is GB140 and peppered with mp3 and wma suffixes too great to engage on an item-by-item level) and cannot check/uncheck at the folder-level the CMD-i/CMD-ALT-i option for "Hide extension" no matter what I try.
Below is w0lf's HDD-universal script and I would like someone in the know to confirm it would work if I rewrite the line ...for item in $1... as ...for item in "€HOME"/Music...?
(NB Must locative elements of scripts be in English language or language that the MBP operates in? E.g. there are no folders called Documents, Pictures, Music et cetera on my computer)
**Begin w0lf's instruction**
- Open Terminal
- Install the Xcode command line tools with this line
Code:
xcode-select --install
- Run these commands
Code:
cd ~/Desktop
touch hide_ex.command
open -e hide_ex.command
- Paste this and save the file
Code:
#! /bin/bash
#
# Hide extensions script
# Hides all extensions on all files for all user accounts
# Requires Xcode command line tools for SetFile
# By : w0lf
#
rr() {
for item in "$1"/*; do
if [[ -d "$item" ]]; then
echo "Entering directory: $item"
rr "$item"
elif [[ -w "$item" ]]; then
echo "Hiding extension for: $item"
SetFile -a E "$item"
fi
done
}
rr /Users
tput bel
- Back in terminal run
Code:
chmod 755 hide_ex.command
./hide_ex.command
- Every file affected will be printed out to terminal, you can minimize terminal and when it's finished you'll hear a ding sound and your minimized terminal window will get a notification badge.
- If you even want to run it again all you have to do is open the file you created which will be on your desktop.
Thanks, everyone.