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.

Referencing FM7 objects with AppleScript

Featured Replies

  • Newbies

I am experiencing difficulty referencing FileMaker Pro 7 objects with AppleScript.

(I realise Apple Events support has been updated, as discussed in TechInfo article "Apple Events In FileMaker 7": http://www.filemaker.com/ti/108943.html)

For example, an AppleScript for FM7:

delete (every record of table "aTable" of database "aDatabase" whose cell "aCell" = "aValue")

This AppleScript only works if the front most window is for database "aDatabase" and a layout for table "aTable" is selected.

If the window for database "aDatabase" is hidden, not front most, or a layout for another table is selected, the result is "FileMaker Pro 7 got an error: Event not handled".

The cell reference causes the error, because a similar script works irrespective of the state of the window for database "aDatabase":

delete (every record of table "aTable" of database "aDatabase")

Question: How to successfully refer to a database > table > cell that may not be in the selected layout of the foreground window?

With thanks in advance

Jim

Version: v7.x

Platform: Mac OS X Panther

If you'r calling the AppleScript from a FileMaker script, you can use

Freeze Window

Go To Layout [...]

Show All Records

before running the AppleScript to ensure you are on the right layout and all records are in the found set.

After the AppleScript:

Go To Layout [Original Layout]

Is this The solution you needed?

I don't think this is an appropriate solution. What is the point of show all record? Normally when people are working with databases, they are trying to work with a particular data set.

set recList to ID of every record of table "aTable" of database "aDatabase" whose cell "aCell" = "aValue"

repeat with thisRec in Reclist

delete record ID thisRec of table "aTable" of database "aDatabase"

end repeat

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.