Selecting from multiple lists

Hi, I’m trying to write a script that lets me select a sound file from 3 or 4 possible folders. Instead of having 3 or 4 “choose from list” commands, is there a way to stick them all in one “choose from list” command?


tell application "Finder" to set allSounds to name of every file in {mainSounds, userSounds}
set theSound to (choose from list allSounds with title "Sounds" with prompt "Select a sound file" OK button name "Select" without empty selection allowed)

Thanks.

Model: 24" iMac 2.4 GHz (late 2007)
Browser: Safari 523.15
Operating System: Mac OS X (10.5)

Hi

Does this work for you!

set mainSounds to {1, 2, 3}
set userSounds to {4, 5, 6}
set x to mainSounds & userSounds
set theSound to (choose from list x with title "Sounds" with prompt "Select a sound file" OK button name "Select" without empty selection allowed)

Thanks for the reply. Literally 30 seconds after I posted my question, I saw the answer on another thread.

Thanks for the help.

The line of code that fixed/made it possible:


set allSounds to (SystemSounds & UserSounds)

That merges both the lists into one list than can be chosen from.

Model: 24" iMac 2.4 GHz (late 2007)
Browser: Safari 523.15
Operating System: Mac OS X (10.5)