List of integer without quote

Guys,

I can’t post here, it’s a nightmare, so here’s the question whitout any figures, quotes or commas:

In AppleScript:

set thetest to Quote & three & four & five & Quote
set thetest2 to thetest as list

So I get:

Open List Bracket & Quote & three & four & five & Quote & Close List Bracket

But what I need is:

Open List Bracket & three & four & five & Close List Bracket

How can I get rid of the quotes?

Sorry, tried posting properly but would let me…

Need an edit here…

Hi,

Assuming that just the inner "&"s are “,” + Space:

set t to “three, four, five”
set def_tid to (AppleScript’s text item delimiters)
set (AppleScript’s text item delimiters) to {", "}
set ti_list to text items of t
set (AppleScript’s text item delimiters) to def_tid
return ti_list

gl,

Hi,

I added the intger coercions:

set t to “1, 2, 3, four”
set def_tid to (AppleScript’s text item delimiters)
set (AppleScript’s text item delimiters) to {", "}
set ti_list to text items of t
set (AppleScript’s text item delimiters) to def_tid
set integer_list to {}
repeat with i in ti_list
try
set i to i as integer
end try
set end of integer_list to (contents of i)
end repeat
integer_list

gl,

Many thanks, that’s exactly what I needed.

Micha

Do you know how to insert brackets in brackets

here is my code

set bracword to “” & MyWord & “”

– there should be brackets in “”
– a bracket should be in " form

Thanks beforehand

I’m not sure what you are asking. Maybe you’re having trouble distinguishing between a string and a list. Here’s how to work with brackets meaning you can use a bracket in a string (although it doesn’t make much sense) or use brackets to denote that the object is a list. If you want a list then you can put lists inside of lists etc. Maybe the following will show you the difference…

set myword to "test"

set a to "{" & myword & "}"
--> a = "{test}"
-- which is a string, it's not a list because everything is between the quotes

set b to "{{" & myword & "}}"
--> b = "{{test}}"
-- which is a string, it is not a list because everything is between the quotes

set c to {myword}
--> c = {"test"}
-- which is a list with a string as one of it's items, note the brackets are not in the quotes

set d to {}
set end of d to myword
set end of d to myword
--> d = {"test", "test"}
-- which is a list with 2 strings in it

set e to {}
set end of e to myword
set end of e to c
set end of e to d
--> e = {"test", {"test"}, {"test", "test"}}
-- which is a list with 3 items - item 1 is a string, item 2 is a list with 1 string in it, item 3 is a list with 2 strings in it