set jsonBuilder to sb's new("{")
repeat with i from 1 to count of attributeNames
if i is not 1 then jsonBuilder's append(", ")
set nextName to item i of attributeNames
set nextValue to item i of attributeValues
set end of nameValueList to nextName
set end of nameValueList to nextValue
jsonBuilder's append("\"" & nextName & "\": ")
if nextValue is missing value then
jsonBuilder's append("null")
else if {integer, real, boolean} contains class of nextValue then