Jump to content

1 folder w. 20 txtfiles imported to FM


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

Recommended Posts

  • Newbies

I have 1 folder with 20 txt-files which I want to import into FM automatically. Each record in FM have 2 fields (1 with the name of the txt-file, the other with the contest of the txt-file).

I have tried to modify the "Import Picture"-script which comes with FM without any success. I get a Filemaker error when the script arrives at set cell "filecontestt" of newRecord to file (txtFileRef). A guess would be that I have to copy/paste the text, instead of importing it. But...I might be wrong!

The modified script:

--choose a folder with text files

activate

set folderPath to (choose folder with prompt "Choose a folder with text files to import

Link to comment
Share on other sites

Change the line to:

set cell "filecontestt" of newRecord to (read txtFileRef as text)

You may also have to coerce txtFileRef to be an alias or file reference rather than a string like this:

set cell "filecontestt" of newRecord to (read alias txtFileRef as text)

Link to comment
Share on other sites

This topic is 7839 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.