"Is this what you're looking for? var rootFold = Folder(selectDialog()); var newFold = Folder(selectDialog()); var folders,fileList = []"