How to create a sheet from a list of list by Applescript?

Hi, I am trying to write a script that can summarise items by different tag groups. I think I’ll be able to create the lol by script but I have never worked on DT sheets. I hope to get help with a basic script for creating a sheet from a lol as kick-starter. I’ll post the final script once it’s ready.

If I have a list of list-of-list like this:

set shtData to ¬
	{{"name1", "name2", "name3", "name4"}, ¬
		{"Content11", "Content12", "Content13", "Content14"}, ¬
		{"Content21", "Content22", "Content23", "Content24"}}

set numCol to length of shtData's item 1
set numRow to (length of shtData) -1

-- How to create a sheet with data specified by shtData?

How to use Applescript create a sheet that looks like this?

Thank you very much in advance

tell application id "DNtp"
	set theCells to ¬
		{{"Content11", "Content12", "Content13", "Content14"}, ¬
			{"Content21", "Content22", "Content23", "Content24"}}
	set theColumns to {"name1", "name2", "name3", "name4"}
	create record with {name:"Sheet", type:sheet, cells:theCells, columns:theColumns} in current group
end tell
1 Like

Excellent. Thank you again!