I use a script to get all the fill colors of every line of a text frame in InDesign CS. Obviously the colors and quantity of colors can change based on each textframe.
After removing all the duplicates I end up with the following list (return_list):
{“Black”, “C=0 M=100 Y=0 K=0”}
When I put the information back into a new text frame (mytext) in InDesign:
set text of mytext to (" "text colors:" & "" & return_list)
I get the following text in the InDesign text frame:
text colors: BlackC=0 M=100 Y=0 K=0
How do I get the the contents of return_list, seperated by a comma and a space, as it is in the list
Well their are a few different things you could do in this scenario
set return_list to {"Black", "C=0 M=100 Y=0 K=0"}
set {ATID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ", "}
set return_list to return_list as string
set AppleScript's text item delimiters to ATID
set return_list to {"Black", "C=0 M=100 Y=0 K=0"}
tell return_list to set return_list to item 1 & ", " & item 2
Hi,
list elements are not separated by comma-space in reality,
this is only an optical syntax element in the source code.
The two elements of your list are just the quoted text
Black
C=0 M=100 Y=0 K=0
To get the kind of list you want use this
set theList to {"Black", "C=0 M=100 Y=0 K=0"}
set {TID, text item delimiters} to {text item delimiters, " "}
set theList to {item 1 of theList, text items of item 2 of theList}
set text item delimiters to ", "
set theList to theList as text
set text item delimiters to TID
--> Black, C=0, M=100, Y=0, K=0
Doh, didn’t know we were looking for everthing ", " seperated
Didn’t know either, but now all possibilities are available 
Thanks, you guys
Actually, James first solution works best, as it seperates the colors into Black and C=0 M=100 Y=0 K=0 (In essence, 100% process magenta)