set json to json & tab2 & "\"text\": {" & return
set t to theText of r
if not q_is_empty(theCopy of t) then
set json to json & tab3 & "\"copy\": \"" & my encode(theCopy of t) & "\"," & return
end if
if not q_is_empty(theLarge of t) then
set json to json & tab3 & "\"largetype\": \"" & my encode(theLarge of t) & "\"" & return
end if
set json to json & tab2 & "}," & return