Because of the single file structure in FileMaker Pro 7 and newer, it's easy to rename a file without having to be concerned with breaking file references and scripts. Although this isn't a normal occurrence, I have one user who insists on adding the version number to the end of the file name. One particular file in the solution has a lot of import routines that constantly had to be reset. For some inexplicable reason, if you change the file name, FileMaker Pro is incapable of remembering that it is importing from one table to another, even in the same file. To avoid the painstaking process of having to locate the file each time to do an import or go through and reset all your scripts, you can use a global variable to get the current file name, then specify the variable as the file from which you're importing.
In my startup script, I add the following line of code:
Set Variable [$$file; get(filename)]
This code gets the name of the current file and stores it in the variable $$file for the duration of the user session, which lets you use it over and over again while you're working. For each scripted import, I start by specifying the actual file and then, after I've saved that import script step, I press the Specify button again, clear out the file reference, and type in $$file. So, no matter what the file name is changed to or how many times it changes, the import will always work correctly without prompting me to locate the file that is being imported.
You could also use a local variable:
Set Variable [$file, get(filename)]
You'd add this script line at the beginning of each import script. Because it's a local variable ($ not $$), it's only stored for the duration of the script itself. This behavior is fine if you only have one or two scripts with imports, but if you're going to perform a lot of imports from different scripts, using the global variable ($$) is much easier.