Skip 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.

Trouble with complex show records script

Featured Replies

  • Newbies

Riddle me this experts. The following is part of an AppleScript being called from within FM 7 with a perform AppleScript command.

show (records whose cell "Committee" = "MA Thesis" or cell "Committee" = "MS Thesis" and cell "Include/Skip" = "Include")

It runs without error, but only shows records based on the first criteria. If I take off the [color:"blue"] and cell "Include/Skip" = "Include" it properly shows records based on [color:"blue"] "Committee" = "MA Thesis" or "Committee" = "MS Thesis". If I put [color:"blue"]and cell "Include/Skip" = "Include" first, it shows records based on [color:"blue"]and cell "Include/Skip" = "Include" and the first of the other criteria, but ignores records matching the second. This script originally was part of a system working in FM 4.5 and we just recently made the big jump to FM7. Now all my scripts are broken. I

The show requests need to be split into two seperate show statements which are between a TELL DOCUMENT statement. When they are between a TELL DOCUMENT statement, it finds the first show request first, then looks for the second show request within that found set.

So the script would be as follows:

[color:"blue"]

tell application "FileMaker Developer"

tell document "test"

show every record

show (every record whose cell "Committee" = "MA Thesis" or cell "Committee" = "MS Thesis")

show (every record whose cell "Include/Skip" = "Include")

end tell

end tell

Say your database has only 7 records.

1 MS THESIS INCLUDE

2 MS THESIS INCLUDE

3 MS THESIS

4 MA THESIS INCLUDE

5 MA THESIS

6 BA THESIS INCLUDE

7 BA THESIS

Step A) The first show statement finds all 7 records

Step : The second show statement, looks at those 7 records from in step A, and shows records 1,2,3,4 and 5

Step C) The third show statement then looks at records 1,2,3,4 and 5 from Step B, for the ones which have INCLUDE and returns records 1,2 and 4

Hope it works for you!

  • Author
  • Newbies

Thanks! Youre code works great. Odd that what was simple and functioning in the old FM does not work now. Is it the result of the more complex file structure in FM7?

To be honest i don't know if this has changed because of the new file structure in FM7!

The databases we use have alll evolved through fm4, fm5 and fm6. When upgrading to fm7 there needed to be a lot of changes to all the applescripting, specifically to do with how cells are addressed (see my previous posts about cell issues!). The new way is a more "correct" way to do it but i'm so used to the old methods that its taking me a bit of time to get my head round it!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.