Sure. You create variable numbers of variables with lists, or lists of lists, or lists of lists of lists, etc.
set myList to {“a”, “b”, “c”, “d”}
set userList to ¬
choose from list (myList) ¬
multiple selections allowed (true)
if (userList is not false) then
-- One of these basic structures should suit
-- your purpose (or coding style):
--
set structureType1 to {}
set structureType2 to {}
repeat with i from 1 to userList's length
set oneUser to {}
set oneUser's end to userList's item i --> "c"
--
set oneUser's end to 3.14159 -- default values
set oneUser's end to "abc" -- for each user
--
set structureType1's end to oneUser
set structureType2's end to userList's item i --> "c"
--
set oneUser to {}
--
set oneUser's end to 3.14159 -- default values
set oneUser's end to "abc" -- for each user
--
set structureType2's end to oneUser
end repeat
end if
structureType1 → { { “c”, 3.14159, “abc” }, { “d”, 3.14159, “abc” } }
structureType2 → { “c”, { 3.14159, “abc” }, “d”, { 3.14159, “abc” } }
There are also the associative list hacks:
<http://applemods.sourceforge.net/files/Types.sit>
<http://www.esglabs.com/macscripts/map.sit.hqx>
<http://applemods.macscripter.net/getMod.php?script_ID=48>
These are script objects with methods that look something like this:
SetValue( "a", 3.14159 ) of AssociativeListObject
GetValue( "a" ) of AssociativeListObject --> 3.14159