Insert file name into a field
Does anyone know a way for a user to browse for a file name and insert just the file name into a field?
I do not want to include the file - just the name of the file.
I know you want just the file path, but bear with me here til you get to the end:
Use a container field, with the insert file script step to open a dialog for finding and inserting the user selected file.
You can specify "store a reference" for the insert file script step since you don't want an actual copy of the file if you want but the following calculation can extract the file name for the inserted file no matter what insertion method and storage option is specified:
//This should work for all insertion and storage methods except Insert Object (Filemaker 11, WIndows only):
Let ( [ T = If ( LeftWords ( YourTable::ContainerFIeld ; 1 ) = "remote" ; GetValue( YourTable::ContainerFIeld ; 1 ) ; GetValue ( YourTable::ContainerFIeld ; ValueCount ( YourTable::ContainerFIeld ) ) ) ;
L = Length ( T )];
If ( LeftWords ( T ; 1 ) = "remote" ; Right ( T ; L - 7 ) ; Right ( T ; L - Position ( T ; "/" ; L ; -1 ) ) )
This can also be found in the database file that can be downloaded from: Exploring the use of a $Path Variable in Scripts
Wow, that's really cool.
Retrieving data ...