List which fills a table - Possible?

Happy new year,

I am busy to write down some idea’s and want to know if this is even possible.

I have a 20+ text files ( .struct ext ). Those text files contains folder structures in text, like;

20+ different structures.

I would like to create a popup list or better a table from those files showing the ‘name - description’ of each struct file, like

.

After choosing a popup item or row, I would like to see the structure in a table, like it is in the struct file, f.e in case of the sample file

.

Is this doable in Applescript and automator, and if yes, is there a sample of a table view in Applescript? I couldn’t find any.

If it is not possible, I should go back for Cocoa? Please advice.

Thanks in advance

Applescript? I don’t think so. AppleScript Studio? Definitely!

This script splits the opened files in name, descriptions and contents:


-- get files
set myFiles to (choose file with prompt "Choose all files to open" with multiple selections allowed)

set structuresData to {}

repeat with i in myFiles
	-- read file
	set theData to (read i) as string
	
	-- get name
	set nameOfStructure to (paragraph 5 of theData) as string -- replace with right paragraph
	set nameOfStructure to (characters 6 thru -1 of nameOfStructure) as string -- get name without "name:"
	
	-- get description
	set descriptionOfStructure to (paragraph 6 of theData) as string -- replace with right paragraph
	set descriptionOfStructure to (characters 13 thru -1 of descriptionOfStructure) as string -- get description without "description:"
	
	-- get contents
	set contentsOfStructure to (paragraphs 7 thru -1 of theData) -- replace with right start paragraph
	set newContentsOfStructure to {}
	repeat with z in contentsOfStructure
		set end of newContentsOfStructure to (z as string)
		set end of newContentsOfStructure to return
	end repeat
	set contentsOfStructure to newContentsOfStructure
	
	set end of structuresData to {nameOfStructure, descriptionOfStructure, contentsOfStructure}
end repeat

get structuresData

I think this is a good start to begin with.

Hope it helps,
ief2

Hi,

Thank you very much for your input.

Right now I am reading some documents from this site about this subject, and also thank you very much for your script sample.