"log" a list and put it into a variable ?

hello all,

Posting this again here because it was kind of off-topic in the previous thread…

I have this line here :

repeat with i from 1 to (count of items of filesList)
       log return & "Item " & i & ": " & ((thePath of item i of filesList) as string) & " : " & ((nbr of item i of filesList) as string) & " changes..."
end repeat

so I can see the items numbers, their paths and the changes in them IN THE CONSOLE, but I need to return that into a NSTextView (as a scrolling list).

I imagine that I have to put the result into a variable for that purpose, but how can I do that ?

Thanks for any help :slight_smile:

Hi,

Do you mean just putting the results into a list?


set resultList to {}
repeat with i from 1 to (count of items of filesList)
	set end of resultList to "Item " & i & ": " & ((thePath of item i of filesList) as string) & " : " & ((nbr of item i of filesList) as string) & " changes..."
end repeat
resultList

that’s exactly what I wanted to do, thanks.
StefanK always got the answer :wink: