Is there a more efficient way to get the property of a list of records?

Looking for programming tips:

(1) Is there a more efficient way (speed) to get the list of name(or uuid) of a list of DT’s records other than using a repeat loop? Thank you!

--example
	set listName to {}
	repeat with each in theList
		set end of listName to name of each		
	end repeat

Not in case of a specific list or selection but in these cases…

…it’s possible:

tell application id "DNtp" to return name of tag groups of database 1

It’s also possible in case of children/parents of a record:

tell application id "DNtp"
	set theRecord to item 1 of (selection as list)
	return name of children of theRecord
end tell

Thanks for the info. Those tips are/will be very useful in many areas.

I am trying to find the intersection of two lists of records. But it seems I can’t use
listA's item i is in listB for comparing a record in a list of records. So I intend to extract the uuid of the two lists, get the intersection of the two lists of string, and converting the intersection back to a list of records.

List processing like that is a known shortcoming in AppleScript.

Thank you again. Just trying to see if there are better ways to script.

I’d recommend you to use scripting additions, like Late Night Software’s List & Record Tolls or Satimage package. They are “masthave” if you deal with lists and records in AppleScript, as @BLUEFROG said, this is a well known shortcoming, esp records :wink:

Thanks again!