To obtain the selected file name, once you click the Open button in the file-dialog window, you use the file method, as in the following example, which assigns the file name to the file variable:
Open
file
file := theFileDialog file.