My solution imports records from a file, processes it and then exports in excel format. How to record the path of imported data file so that an export script can export into the same directory?
They way I do it is to import the file into a global field as a reference. I can then parse the path from the text stored in the global field.
This is one way to create the path:
Let ( [
~importedFile = Substitute ( LeftValues ( Table::GLOBAL.FIELD ; 1 ) ; "file:" ; "" );
~exportedFile = "myFile.xls"
Substitute ( RightValues ( Table::GLOBAL.FIELD ; 1 ) ; ~importedFile ; ~exportedFile )
Set it to a variable before the export step and the use that variable the specify output file dialog box. The ~exportedFile value is literal in the example, however normally I would use a variable or calculation to dynamically name it.
great reference on this topic can also be found at:
Exploring the use of a $Path Variable in Scripts . Using FileMaker Pro . Forum . FileMaker Forums
Retrieving data ...