applescript: creation of reports of iOS devices using Apple Configurator (scripts library)

My goal is to use the Apple Configurator 2 utility to create system information about iPads and iPhones that I buy and quickly put this information in my database. So far this has been done with a lot of sticking and copying tedious and prone to errors.

I have come across some scripting solutions that can help automate this enormously. I mainly use Python on a daily basis and I have a bit of trouble "joining the dots" with AppleScript.

There are some examples of how AppleScript and the Configurator's command-line tools work at https://configautomation.com/handlers.html. Everything here comes from those examples.

I have done everything possible to join two sample scripts so that all connected devices of a particular type (iPad) in this case can have specific information on serial numbers, IMEI, device type, etc. which can then be extracted in Python.

Tell script "Configuration utility"
- get information for connected devices of the specified type
copy CNFGdevicesMatchingSpecifiedClass ("iPad", false) to ¬
{deviceCount ¬
, property Titles ¬
, theseDeviceECIDs ¬
, these kinds of devices ¬
, these types of devices ¬
, theseDevices

- process devices
repeat with i from 1 to deviceCount
set thisECID to item i of theseDeviceECIDs
try
Tell script "Configuration utility"

set this property to "deviceType"
set currentPropertyValue to CNFGspecifiedPropertyValueForSpecifiedDevice (thisProperty, thisECID)
tell him at the end
in error errorMessage
"ERROR" alert message error Message buttons {"Cancel"} cancel button 1
final test
end of repetition

This prints the "deviceType" again as "iPad5.3" in my example.

Of course, this will only work in a device class (iPad or iPhone) at any given time. I would prefer that I could handle all the connected devices.

Here is another script that will print the "ECID" of all connected devices, regardless of the type. An ECID is somewhat similar to a serial number.

try
Tell script "Configuration utility"
set these ECIDs to CNFGdeviceECIDs ()
tell him at the end
in error errorMessage
"ERROR" alert message error Message buttons {"Cancel"} cancel button 1
final test

How can I make the first script behave like the second and return system-specific information for all the devices connected to my Mac?

Thank you.