I haven’t experienced a table overflow on such a simple script. It seems to be if I have two simple lists of 3000-4000 strings. Any advice? Ironically when I tried to create this topic it errors with An error occurred: Body is limited to 32000 characters; you entered 76616. lol. So you’ll have to increase the size of these lists to 3000-4000 items to test.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set wtf to "6405CVC"
set theResult to my testVendors(wtf)
on testVendors(testStyle)
set vendorAPI to missing value
---list one here needs more items
set allSSStyles to {"4700", "4710", "N3142", "N3165", "N3373", "N3381", "N3409", "N3425", "N4279", "N5293", "N5296", "N5338", "NB3142", "NB5301", "NW3002", "NW3201", "NW3402", "EB101", "LP101", "A1000", "A12S", "A130", "A131", "A166", "A186", "A190", "A191", "A207", "A213", "A230", "A231", "A233", "A236", "A240", "A241", "A267", "A268", "A280", "A281", "A284", "A285", "A295", "A322", "A323", "A324", "A325", "A373", "A376", "A377", "A401", "A402", "A403", "A416", "A417", "A430", "A431", "A432"}
--list 2 here needs more items
set allSanmarStyles to {"29M", "4662M", "5170", "5180", "5186", "5190", "5280", "5370", "562M", "P160", "P170", "B100", "4850MP", "4997M", "B300", "B050", "562B", "4528M", "S100", "BTU", "973M", "F260", "S600", "S600T", "996Y", "054X", "29B", "PWU", "S500T", "SP10", "993M", "437M", "HCF", "B400", "K420", "SP11", "K320", "436MP", "J730", "PC61", "5250", "L420", "K431", "J753", "J754", "TLJ754", "PC61Y", "PC61P", "PC61LS", "996M", "C800", "J777", "K420P", "TLS600", "TLS600T", "PC90", "PC90H", "PC55"}
if allSanmarStyles contains testStyle then
set vendorAPI to "Sanmar"
else if allSSStyles contains testStyle then
set vendorAPI to "SSActivewear"
end if
return vendorAPI
end testVendors
`