Q: perhaps, simple question variable string in pop-up
Hi
I write a names who helped me in previous question but now list is very big and sorry, without personal nicks
Hi all
we have a string
set scany_col to {{15677, 5654, 7453}, {37008, 19532, 17733}, {32896, 15163, 14906}, {15934, 6939, 9509}, {16705, 6682, 9252}, {38293, 39064, 40092}, {19532, 6939, 8224}, {65535, 65535, 65535}, {17219, 6425, 8738}, {24158, 9509, 11051}, {14392, 5911, 8481}, {22873, 16448, 16191}, {30840, 14649, 14649}, {29041, 16191, 15934}, {12593, 5397, 8224}}
--(this is a RGB colors of the pixels)
choose from list scany_col with title "which color at the first position"
set listreturn to result
listreturn
...a-a-and this script returns a mistake "cant bla-bla with string"
Tell me please, what is wrong?
MacBook Pro, OS X El Capitan (10.11.2)
Posted on Jul 7, 2016 9:48 AM
The sublists aren't themselves strings or numbers.
If you'd like to choose from one of the sublists, replace the choose from list command with:
choose from list (item 1 of scany_col) with title "which color at the first position"
If you'd like to pick a specific sublist out of all of them:
set scany_col to {{15677, 5654, 7453}, {37008, 19532, 17733}, {32896, 15163, 14906}, {15934, 6939, 9509}, {16705, 6682, 9252}, {38293, 39064, 40092}, {19532, 6939, 8224}, {65535, 65535, 65535}, {17219, 6425, 8738}, {24158, 9509, 11051}, {14392, 5911, 8481}, {22873, 16448, 16191}, {30840, 14649, 14649}, {29041, 16191, 15934}, {12593, 5397, 8224}}
set scany_strings to {}
repeat with this_item in scany_col
set scany_strings to scany_strings & ((item 1 of this_item as string) & ", " & (item 2 of this_item as string) & ", " & (item 3 of this_item as string))
end repeat
choose from list scany_strings with title "which color at the first position"
set listreturn to result
listreturn
(143331)
Posted on Jul 7, 2016 9:57 AM