Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7377 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I need to import a file which is always located in the same directory. The file always starts with "SEL". One week the import file is SEL01X.xls, the next week it may be SEL28W.xls. I would like for FileMaker to automatically find this file in the designated directory and import it. After the import then for FileMaker to automatically rename the file from SELxxx.xls to XSELxxx.xls, so that it would not import automatically again, because it placed a "X" in front of the file name. Can this be done and how? Thanks.

Posted

A saved FileMaker Import script step (no dialog) will always import from the same named file and location; so the file needs to be named the same.

FileMaker cannot manipulate files, at all. If you're on a Mac, AppleScript can easily. On Windows there are either commands, or plug-ins. I use the Troi File plug-in on cross-platform solutions.

I'd do it like this. Have a "files to import" folder, and a "files done" folder.

Put the new files in the import folder (which is in a known location).*

Troi can get a list of file names in that folder; put it in a multi-line global field.

Go down the list, one line at a time; put the name in a 1-line global field.

Reconstruct the file path, with the folder path & the name.

Rename the file to the fixed name that the FileMaker Import expects.

Import.

Move/rename the file to its original name, move into the Done folder (this is one step).

Repeat with next file. Stop when there's no files left (duh, but you have to tell it, 'cause this is a loop).

*You can use the Get (FilePath) function for the FileMaker database file's location. Construct the Import folder's path from it's relative relation to the database file. That way it'll work on any computer. Troi can also give you the path of the Desktop, if that's more convenient. Or you can put a Shortcut (Alias) of the real folders on the Desktop.

(P.S. Put your FileMaker version and platform into your account profile here on FM Forums, so we know which version/terms to tell you about.)

This topic is 7377 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.