Skip to content

Instantly share code, notes, and snippets.

@psu
Last active May 5, 2023 10:51
Show Gist options
  • Save psu/ea3bee9fbcfd9db8368153874dae6350 to your computer and use it in GitHub Desktop.
Save psu/ea3bee9fbcfd9db8368153874dae6350 to your computer and use it in GitHub Desktop.
handle-files.sh
# Change encoding for text file
iconv -f "ISO-8859-1" -t "UTF-8" "${input_file}" -s > "${output_file}"
# Remove tags and move to Archive folder
for file in {query}
do
# remove tag information in extended attributes, FinderInfo contains color info
xattr -d com.apple.metadata:_kMDItemUserTags "$file"
xattr -d com.apple.FinderInfo "$file"
# move file
mv "$file" "$archive_path"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment