I got back to playing with that ‘record’ framework and remembered all the things that annoyed me about it. At any rate, I’ve uploaded a faceless background app that incorporates the framework - which solves the immediate issue, at least - while I puddle with the framework itself to see if I can work past the irritating bits. I’ll put the source code up somewhere after I’ve fussed with it a bit more, if only as an object lesson in head-banging.
set b to {name:1, dd:2, id:"xxx", qq:{name:"zelda", w:"hello"}, r:{1, 2, {a:"a", b:"b"}, 3}}
set z to {{a:1, b:7, c:"hello", name:"whimpy"}, {a:5, b:2, c:"goodby", name:"grumpy"}, {a:3, b:3, c:"whatever", name:"moseley"}, {a:3, b:2, c:"goodby", name:"grumpy"}}
set c to (system info)
tell application "Sidecar"
keys of b
--> {"r", name, "dd", id, "qq"}
keys of c
--> {physical memory, host name, CPU type, system version, long user name, AppleScript version, computer name, IPv4 address, AppleScript Studio version, boot volume, user ID, user locale, home directory, short user name, primary Ethernet address, CPU speed}
subset of b for keys {name, "dd"}
--> {name:1, dd:2}
values of b for keys {"dd", name, "qq", "r"}
--> {2, 1, {name:"zelda", w:"hello"}, {1, 2, {a:"a", b:"b"}, 3}}
sort keys of b
--> {dd:2, qq:{name:"zelda", w:"hello"}, r:{1, 2, {a:"a", b:"b"}, 3}, id:"xxx", name:1}
sort z using criteria {{key:"a", direction:down}, {key:"b", direction:up}}
--> {{name:"grumpy", b:2, c:"goodby", a:5}, {name:"grumpy", b:2, c:"goodby", a:3}, {name:"moseley", b:3, c:"whatever", a:3}, {name:"whimpy", b:7, c:"hello", a:1}}
filter z using predicate "a == 3"
--> {{name:"moseley", b:3, c:"whatever", a:3}, {name:"grumpy", b:2, c:"goodby", a:3}}
end tell