In Game Dropdown Box Using Folder As Data(javascript)

Is there a way in game to make a drop down box to pick diferent things? With GUI? Also with that is there a way for it to look through a folder and for each sub folder create one containing the values of the sub folder? Maby parsing each folder? So if you have a folder lets say this. The first box would contains sub folders 1 and 2 and if you click on sub folder one it shows File.

Folder

-SubFolder 1

–File

-SubFolder 2

There’s something similar like that on the unify wiki:

Maybe this will give you some pointers.

Is there a javascript version?