-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessPresets
More file actions
191 lines (173 loc) · 7.68 KB
/
processPresets
File metadata and controls
191 lines (173 loc) · 7.68 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/bash
# sorting identifiers
suffixWIDE="_WIDE"
suffixSTD="_STD"
suffixHD="_HD"
suffixSD="_SD"
suffixLS="_LS"
suffixPR="_PR"
suffixSQ="_SQ"
suffixBL="_BL"
suffixOR="_OR"
suffixTH="_TH"
suffixAE="_AE"
suffixTP="_TP"
suffixCH="_CH"
suffixFS="_FS_"
suffixFR="_FR_"
suffixPV="_PV_"
prefixTT1="TT1_"
prefixTT2="TT2_"
prefixTT3="TT3_"
prefixAlt1="Alt1_"
prefixAlt2="Alt2_"
prefixAlt3="Alt3_"
prefixL3="L3_"
prefixPP=".pptx"
prefixFS="FS_"
prefixFR="FR_"
prefixPV="PV_"
prefixWB="WB_"
prefixUW="UW_"
prefixCD="Countdown_"
prefixTV="Trivia_"
prefixBP="Bumper_"
#
#preset tags
presetTT1="#preset=tg_title1"
presetTT2="#preset=tg_title2"
presetTT3="#preset=tg_title3"
presetAlt1="#preset=tg_alt1"
presetAlt2="#preset=tg_alt2"
presetAlt3="#preset=tg_alt3"
presetL3WIDE="#preset=tg_transparent_png_download_wide"
presetL3STD="#preset=tg_transparent_png_download_standard"
presetL3TH="#preset=tg_transparent_png_preview"
presetPPWIDE="#preset=ppt_wide"
presetPPSTD="#preset=ppt_standard"
presetSOR="#preset=social_orientations"
presetSLS1="#preset=social_landscape1"
presetSLS2="#preset=social_landscape2"
presetSPR1="#preset=social_portrait1"
presetSPR2="#preset=social_portrait2"
presetSSQ1="#preset=social_square1"
presetSSQ2="#preset=social_square2"
presetSFRLS="#preset=download_only#display_resolution=Landscape"
presetSFRPR="#preset=download_only#display_resolution=Portrait"
presetSFRSQ="#preset=download_only#display_resolution=Square"
presetSFRTP="#preset=preview_only#preset=social_square1"
presetSMLS="#display_resolution=Landscape"
presetSMPR="#display_resolution=Portrait"
presetSMFRLS="#original_content_type=not_transformable#output=download#display_resolution=Transparent#name=Landscape"
presetSMFRPR="#original_content_type=not_transformable#output=download#display_resolution=Transparent#name=Portrait"
presetSMFRSQ="#original_content_type=not_transformable#output=download#display_resolution=Transparent#name=Square"
presetSMFRCH="#original_content_type=not_transformable#output=preview"
presetAE="#preset=aep_zip"
#
for i in *.jpg *.png *.pptx; do
if [[ "$i" != "*.jpg" ]] && [[ "$i" != "*.png" ]] && [[ "$i" != "*.pptx" ]]; then
if [[ "$i" == *"#preset="* ]]; then
named="TRUE"
else
# determine filetype
if [[ "$i" == *".jpg"* ]]; then
fileType=".jpg"
elif [[ "$i" == *".png"* ]]; then
fileType=".png"
elif [[ "$i" == *".pptx"* ]]; then
fileType=".pptx"
fi
# image titles
if [[ "$i" == *"$prefixTT1"* ]]; then
mv "$i" "${i%"$fileType"}${presetTT1}$fileType"
elif [[ "$i" == *"$prefixTT2"* ]]; then
mv "$i" "${i%"$fileType"}${presetTT2}$fileType"
elif [[ "$i" == *"$prefixTT3"* ]]; then
mv "$i" "${i%"$fileType"}${presetTT3}$fileType"
# image alts
elif [[ "$i" == *"$prefixAlt1"* ]]; then
mv "$i" "${i%"$fileType"}${presetAlt1}$fileType"
elif [[ "$i" == *"$prefixAlt2"* ]]; then
mv "$i" "${i%"$fileType"}${presetAlt2}$fileType"
elif [[ "$i" == *"$prefixAlt3"* ]]; then
mv "$i" "${i%"$fileType"}${presetAlt3}$fileType"
# image lower thirds
elif [[ "$i" == *"$suffixTH"* ]]; then
mv "$i" "${i%"$fileType"}${presetL3TH}$fileType"
elif [[ "$i" == *"$prefixL3"* ]] && [[ "$i" == *"$suffixWIDE"* ]]; then
mv "$i" "${i%"$fileType"}${presetL3WIDE}$fileType"
elif [[ "$i" == *"$prefixL3"* ]] && [[ "$i" == *"$suffixSTD"* ]]; then
mv "$i" "${i%"$fileType"}${presetL3STD}$fileType"
# powerpoints
elif [[ "$i" == *"$prefixPP"* ]] && [[ "$i" == *"$suffixWIDE"* ]]; then
mv "$i" "${i%"$fileType"}${presetPPWIDE}$fileType"
elif [[ "$i" == *"$prefixPP"* ]] && [[ "$i" == *"$suffixSTD"* ]]; then
mv "$i" "${i%"$fileType"}${presetPPSTD}$fileType"
# image socials
elif [[ "$i" == *"$suffixOR"* ]]; then
mv "$i" "${i%"$fileType"}${presetSOR}$fileType"
elif [[ "$i" == *"$suffixFS"* ]] || [[ "$i" == *"$suffixPV"* ]]; then
if [[ "$i" == *"$suffixLS"* ]] && [[ "$i" != *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSLS1}$fileType"
elif [[ "$i" == *"$suffixPR"* ]] && [[ "$i" != *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSPR1}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" != *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSSQ1}$fileType"
elif [[ "$i" == *"$suffixLS"* ]] && [[ "$i" == *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSLS2}$fileType"
elif [[ "$i" == *"$suffixPR"* ]] && [[ "$i" == *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSPR2}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" == *"$suffixBL"* ]]; then
mv "$i" "${i%"$fileType"}${presetSSQ2}$fileType"
fi
elif [[ "$i" == *"$suffixFR"* ]]; then
if [[ "$i" == *"$suffixLS"* ]]; then
mv "$i" "${i%"$fileType"}${presetSFRLS}$fileType"
elif [[ "$i" == *"$suffixPR"* ]]; then
mv "$i" "${i%"$fileType"}${presetSFRPR}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" != *"$suffixTP"* ]]; then
mv "$i" "${i%"$fileType"}${presetSFRSQ}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" == *"$suffixTP"* ]]; then
mv "$i" "${i%"$fileType"}${presetSFRTP}$fileType"
fi
fi
fi
fi
done
for i in *.mov *.mp4 *.zip; do
if [[ "$i" != "*.zip" ]] && [[ "$i" != "*.mov" ]] && [[ "$i" != "*.mp4" ]]; then
if [[ "$i" == *"#preset="* ]] || [[ "$i" == *"#original_content_type="* ]]; then
named="TRUE"
else
# determine filetype
if [[ "$i" == *".mov"* ]]; then
fileType=".mov"
elif [[ "$i" == *".mp4"* ]]; then
fileType=".mp4"
elif [[ "$i" == *".zip"* ]]; then
fileType=".zip"
fi
# ae project
if [[ "$i" == *".zip"* ]]; then
mv "$i" "${i%"$fileType"}${presetAE}$fileType"
# motion socials
elif [[ "$i" == *"$suffixFS"* ]] || [[ "$i" == *"$suffixPV"* ]]; then
if [[ "$i" == *"$suffixLS"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMLS}$fileType"
elif [[ "$i" == *"$suffixPR"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMPR}$fileType"
fi
elif [[ "$i" == *"$suffixFR"* ]]; then
if [[ "$i" == *"$suffixLS"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMFRLS}$fileType"
elif [[ "$i" == *"$suffixPR"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMFRPR}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" != *"$suffixCH"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMFRSQ}$fileType"
elif [[ "$i" == *"$suffixSQ"* ]] && [[ "$i" == *"$suffixCH"* ]]; then
mv "$i" "${i%"$fileType"}${presetSMFRCH}$fileType"
fi
fi
fi
fi
done