Shane,
This is totally awesome! Many thanks for your reply.
If this is not already in your book, may I suggest that you add it to the next edition?
BTW, I will be posting my final scripts/handlers for dynamic use of AppleScript Records in the next day or so.
IMO, this is huge, because it removes one major disadvantage of using AppleScript vs JXA/_javascript_ (JS objects (aka "records") are very powerful).
Best Regards,
Jim Underwood
aka
JMichaelTX
So after you have checked for missing value:
set theResult to theDict's objectForKey:pKeyStr
set someArray to current application's NSArray's arrayWithObject:theResult
return item 1 of (someArray as list)
What this does is makes a single-item array containing theResult. When that's converted to an AppleScript list, the item within it will also be converted to an AppleScript item if it can. So this covers all the bridgeable AS classes -- text, numbers, lists,
records, whatever. You then extract the item from the list.