tell application "Adobe Photoshop CS5.1"
activate
set textName to name of current document
set the1stLetter to the first character of textName --> the 1st letter
set the2ndLetter to the second character of textName --> the 2nd letter
set the5thLetter to the fifth character of textName --> the 5th letter
set the6thLetter to the sixth character of textName --> the 6th letter
set ItemType to {the5thLetter, the6thLetter} as text
set brandID to {the1stLetter, the2ndLetter} as text
if brandID is in {"BH", "AL", "SM"} then
set targetWidth to 1348
set targetHeight to 1832
else if brandID is in {"BU", "TM"} then
set targetWidth to 1020
set targetHeight to 1385
else if brandID is equal to "ES" then
set targetWidth to 1280
set targetHeight to 1740
else if brandID is in {"DV", "DJ", "RA"} then
set targetWidth to 1000
set targetHeight to 1360
else if brandID is in {"FR", "WA", "NN"} then
set targetWidth to 1020
set targetHeight to 1530
else if brandID is in {"MA", "MB", "MC", "MF", "MH", "FI"} then
set targetWidth to 1000
set targetHeight to 1400
end if
if brandID is not equal to "TM" then
if brandID is equal to "TM" and ItemType is not equal to "NW" then
do action "TightCrop" from "NEW CROP SET"
File labels are as below and how each file should be treated
TM15NW is equal to TM and is equal to NW this should avoid the script
TM15ER is equal to TM but not equal to NW therefore do the script
FR10NW is not equal to TM, do the script
FR10ER is not equal to ER do the script
I hope this make sense, but essentially the only top file listed should bypass the script.?
Can you help with my logic?