Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Importing text into FileMaker

Featured Replies

I have another little conundrum involving transferring data from one file to another.

This time I need to lift the contents of a text file into a single field in FileMaker . . .a seemingly trivial task that is very easily performed manually.

I wrote the script enclosed for this which works well until TextEdit hits it's memory ceiling. What I want to know is, is there any way I can lift the text straight out of the file without going via TextEdit, or is there another way round this problem.

The text files are large (~250,000 lines), so the other methods of importing into FileMaker have proven too cumbersome and I need to be able to import the text before I can break it up into useable elements. As usual, it is trying to get FileMaker to do something for which it was not really intended.

thanks in advance for any hints, scorn or queries

Anatole

-- request the file containing the text 

set filePath to POSIX path of (choose file with prompt "Select text file for import" without invisibles)



-- get the text of file and put it in current FileMaker record

tell application "TextEdit"

	open POSIX file filePath as alias

	set docCopy to text of document 1

	close document 1

end tell



try

	tell application "FileMaker Pro Advanced"

		tell table "_PostScript_settings"

			set contents of cell "textfile" to filePath as text

			set contents of cell "fulltext" to docCopy

		end tell

	end tell

end try

  • Author

OK - another step forward

The following code works from Script Editor, but won't work from FileMaker. I presume I need to put the open and set lines within a try using application "XX". I have tried Finder and System Events, but then it doesn't read the POSIX file.

-- request the file containing the text 

set filePath to POSIX path of (choose file with prompt "Select text file for import" without invisibles)



-- get the text of file and put it in current FileMaker record

open for access file filePath

set docCopy to read POSIX file filePath as text



try

	tell application "FileMaker Pro Advanced"

		tell table "_PostScript_settings"

			set contents of cell "textfile" to filePath as text

			set contents of cell "fulltext" to docCopy

		end tell

	end tell

end try

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.