Part 2
set dateYr to {C:"2010(1st half)", D:"2010(2nd half)", F:"2011(1st half)", G:"2011(2nd half)", H:"2012(1st half)", J:"2012(2nd half)", K:"2013(1st half)", L:"2013(2nd half)", M:"2014(1st half)", N:"2014(2nd half)", P:"2015(1st half)", Q:"2015(2nd half)", R:"2016(1st half)", S:"2016(2nd half)", T:"2017(1st half)", V:"2017(2nd half)", W:"2018(1st half)", x:"2018(2nd half)", Y:"2019(1st half)", Z:"2019(2nd half)"}
-- Apple codes for first 28 week builds
set week28 to {"1", "2", "3", "4", "5", "6", "7", "8", "9", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "T", "V", "W", "X", "Y", "Z"}
set manyear to my dict_value(dateYr, yom) as text
set manweek to 0 as integer
repeat with i from 1 to count of week28
if ((item i of week28) contains wom) is true and (manyear contains "(1st half)") is true then
set manweek to (i as integer)
else if manyear contains "2nd half" then
set manweek to (i + 26) as integer
end if
if not manweek = 0 then exit repeat
end repeat
set YR to characters 1 thru 4 of manyear
set YR_WK to ((YR as text) & space & manweek as text)'s quoted form
-- monday of manufacture week
set mondate to (do shell script "date -j -f \"%Y %V\" " & YR_WK & " +%F")
-- saturday of manufacture week
set satdate to (do shell script "date -j -v Sat -f \"%Y %V\" " & YR_WK & " +%F")
display dialog "Model: " & model & return & "Manufactured: " & "Mon " & mondate & " thru Sat " & satdate with title "Model and Manufactured Week"
return
on dict_value(adict, akey)
return ((NSDictionary's dictionaryWithDictionary:adict)'s valueForKey:akey) as text
end dict_value