Join List items v2

Version 2.
Now allows you to add single quotes,double quotes or no quotes around each list item  as it is placed in the final string. This is useful for example  in placing single quotes around file paths in the list. 

Examples

Needed Use Clauses

use script "Text Utils"

#example 1.

set theList to { "/Users/UserName/Folder 1", "/Users/UserName/Folder 2"}

 join list items theList using text " " with items in single quotes

Result:

"'/Users/UserName/Folder 1' '/Users/UserName/Folder 2' "


#example 2.

set theList to { "the", "cat", ", "over"}

join list items theListusing text "" with items in no quotes

Result:

"thecatjumpover"


#example 3.

set theList to { "the", "cat", "jump", "over"}

join list items theListusing text "," with items in no quotes

Result:

"the,cat,jump,over"


Read the original post → Join List items Applescript Script libraries command

Download this version. 

Download “Text-Utils.scptd_v2” Text-Utils.scptd_v2.zip – Downloaded 365 times – 9 KB

 

Hi, Please Leave a Reply