Is has to be easier than this:
set lista_orig to {"1 ", "2 ", "3 ", "4 ", "5 ", "6 ", "7 ", "8 ", "9 ", "10"}
set i to 2 -- the item to extract
try
set lista_truncada to sacar_item(lista_orig, i)
on error
display dialog "Not posible!" buttons {"OK"} default button 1
set lista_truncada to la_lista
end try
return (lista_orig) & return & return & (lista_truncada)
on sacar_item(lista, i)
if i = 1 then
set lista to (rest of lista)
return lista
else if i > 1 then
set el_primero to (item 1 of lista)
set (item 1 of lista) to (item i of lista)
repeat until i = 2
set (item i of lista) to (item (i - 1) of lista)
set i to (i - 1)
end repeat
set lista to (rest of lista)
set (item 1 of lista) to el_primero
return lista
else if i < 1 then
set lista to (lista div 0) -- crashes try
end if
end sacar_item
rest of “list” is just for the first one, and all the others?