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.

Field Order in FileMaker Layouts and AppleScript

Featured Replies

  • Newbies

(Posted the same question at MacScripter, but it is very specific about FileMaker 12.) Background: A plug-in for some other software (“RagTime”) retrieves data from FileMaker via AppleEvents. With FileMaker 12, I have got a problem.

Imagine a simple FileMaker database “contacts” with two tables, “companies” and “employees”. There is a FileMaker layout displaying the address data for a company and in portal rows, the employees are listed.

First script example:

set fm_db to "contacts"
tell application "FileMaker Pro"
    tell window 1 of document fm_db
        set my_result to (get data of current record)
    end tell
end tell
my_result

This returns all values from the record. Fields in portal rows are returned as lists with one entry for each employee.

Second Script:

set fm_db to "contacts"
tell application "FileMaker Pro"
    tell window 1 of document fm_db
        set my_result to (get data of every cell of current record)
    end tell
end tell
my_result

This returns a list where only the first employee appears as a single entry. But there is a second difference: The first script returns the fields in the order of the geometrical arrangement in the layout (top-down, left-right). The second script seems to return the fields in the order in which they have been added to the layout.

A third script to get the field names:

set fm_db to "contacts"
tell application "FileMaker Pro"
    tell window 1 of document fm_db
        set my_result to (get name of every field)
    end tell
end tell
my_result

Now finally the problem: I need the lists of employees as in the first script and I need the field names, the values belong to. But the thirds script uses the same order as the second.

Currently I got stuck. Does any FileMaker scripter know a way to retrieve data from a window including all portal rows and to retrieve the field names in a consistent order?

(FileMaker 5 through 11 used the same order for field names as for the values in script 1.)


Jürgen

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.