September 20, 200718 yr Hi, Is there a way to import a txt file into one single field instead of breaking it up into multiple records? I'd like to import the whole content of one txt file into one field / variable! Any help would be appreciated! Robin
September 20, 200718 yr I can think of a couple of ways. A native FileMaker method would be to use the Import Folder step. It will import text files into a single field. But, of course, you'd have to put the single file into a folder first. Another slightly more difficult, but more convenient method would be to use AppleScript to read the file, then set it into a field. Or use a file plug-in. But that's really the same thing, for more money. This is an AppleScript that reads a chosen text file using the Unix "cat" command line. It creates a new record in the frontmost FileMaker window with the name and contents: global theName global theContents set theFile to choose file with prompt "Choose a text file" tell application "Finder" set theName to name of theFile set posFile to quoted form of POSIX path of theFile set theContents to do shell script "cat " & posFile -- converts Unix to Mac returns my FM_Create_Record() end tell on FM_Create_Record() tell application "FileMaker Pro Advanced" -- not needed in FileMaker tell window 1 set newRec to the ID of (create new record) go to record ID newRec set cell "Filename" of current record to theName set cell "Contents" of current record to theContents end tell end tell -- me neither end FM_Create_Record
September 20, 200718 yr Author Thanks a lot for the reply! As this application will also be running on a PC client (no Applescript), I think the easiest way is for me to do the import folder step and make sure taht just that file is in the folder! Robin
Create an account or sign in to comment