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.

inset text to a field of the Current Record

Featured Replies

I have a short AppleScript to insert a text file into a specific field in FM8. However, I only want the file to go into the field of the Current Record.

Is there a way of doing this using:

set cell "XYZ" of record Current Record of table "ABC" to text_file As text

?

Thanks,

Charlie

The phrase "insert a text file" could have 2 meanings. Do you mean a FileMaker "Insert File" (as a file) or do you mean "put the text contents of a text file into a field"?

If the latter, you can read a text file with AppleScript, using either:

read file "Mac path to file"

or

do shell script "cat POSIXpathToFile"

(should be "quoted form of POSIXpathToFile" if there's any spaces, which there usually are)

"Read File" must be in a Finder or other tell block if inside a FileMaker Perform AppleScript step, not just on its own:

tell application "Finder" to set theTxt to read file "Mac path to file"

set cell "Txt" of current record of layout "layout name" to theTxt

(P.S. I don't think "table" has a current record, only layout; the current layout being the default.)

  • Author

I want to insert the contents of a text file. The script example will do this, and actually give me a dialog box with which to select the file.

However, the crunch is which record, the text file gets inserted into.

I need to be able to tell FM from Applescript which Record - ie. the Record number that corresponds to the Current Record

Regards,

Charlie

  • Author

Fenton,

I sorted it with the following script:

tell application "Finder"

set the file_to_read to read ¬

(choose file with prompt ¬

"Select contig file:")

tell application "FileMaker Pro Advanced"

tell database "Molecular Lab Database.fp8"

tell window "Molecular Lab Database"

set field "Imported Consensus" to file_to_read as text

end tell

end tell

end tell

end tell

Thank-you for all your input to this and my other queries.

Regards,

Charlie

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.