The XFCN execution returns a dialog box which contains a list of only those files which match the filetype. The value returned by the function is the full name of the file including location (e.g., "HD-20:Hyper Stacks:Home")
Restypes:
"TEXT" - ASCII text files
"STAK" - HyperCard stack files
"APPL" - Applications
------------------------------
examples
A.
on mouseUp
get FileName("TEXT")
if it is not empty then put it into newfile
open newfile
read from file newfile until return
put it into field maintext
close newfile
end mouseUp
B.
on mouseUp
put filename("STAK") into fname
if fname is empty then exit mouseUp
deprotect fname
if the result is empty
then answer "Deprotect Successful" with "OK"
else if the result is -49
then answer "Sorry, that file is busy."
else if the result is -44
then answer "Sorry, the disk is locked."
else answer "Failed: unexpected file system error: " & the result with "OK"