-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathreveal
32 lines (26 loc) · 1.04 KB
/
reveal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
echo "❦ Font Revealer for Adobe Creative Cloud ❦"
echo "Dry-Run will preview the renaming process without copy any files."
select dce in "Dry-Run" "Copy" "Exit"; do
case $dce in
Dry-Run ) isDry=true; echo "Dry-running..."; break;;
Copy ) isDry=false; echo "Copy & rename files..."; break;;
Exit ) exit;;
esac
done
cd $HOME/Library/Application\ Support/Adobe/CoreSync/plugins/livetype/
# grab all otf dot files (adjust to your needs)
find . -type f -iname "*.otf" | while read file
do
# the "Postscript name:" does not contain spaces. good for file names.
fontName=`otfinfo --info ${file} | fgrep "PostScript name:" | grep -oE "[^ ]+$"`
if [ "$isDry" = false ] ; then
# create a FONT dir within downloads, if there is none
mkdir -p $HOME/Downloads/FONTS/
# copy files (if no dry-run)
cp $file "$HOME/Downloads/FONTS/$fontName.otf"
fi
# echo changes:
echo "$file\t⮕\t$fontName.otf"
done
echo "🚀 DONE! Check your 'FONTS' directory within Downloads if you selected Option 2 (Copy)".