There is no built-in way to obtain a list of the names of the items of a record
(That was more or less true at the time)
use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
-- keys :: Dict -> [String]
(current application's NSDictionary's dictionaryWithDictionary:rec)'s allKeys() as list
-- lookupDict :: String -> Dict -> any
on lookupDict(k, rec)
-- Just the value of k in the dictionary,
-- or missing value if k is not found.
set ca to current application
set v to (ca's NSDictionary's dictionaryWithDictionary:rec)'s objectForKey:k
if missing value ≠ v then
item 1 of ((ca's NSArray's arrayWithObject:v) as list)
(and AppleScript is in late sunset mode, not least because there is no scope for it on iOS)