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.

Avoid updating window during batch load (newbie)

Featured Replies

I'm writing an Applescript app to fetch a large amount of data and add records to a FMP database. The process is time-consuming, and I'd like for the user to be able to switch away from FMP and do other work. However, whenever I try this, FMP stops and bounces its icon in the dock until I switch back to FMP. It appears to want to be brought to the foreground to display every new record as it's loaded.

I would swear that, in an earlier incarnation of this application, FMP did not attempt to display every new record as it was added, and did not complain if I switched away from it. I have no idea what I have done to tell it to show me its progress!

Any ideas or followup questions?

Thanks, Chap

Can't you do this (or some of it) with FMP scripts rather than AppleScript? FMP can run scripts in the background no problems as long as no user imput is required for dialogs and whatnot.

"I would swear that, in an earlier incarnation of this application, FMP did not attempt to display every new record as it was added, and did not complain if I switched away from it. I have no idea what I have done to tell it to show me its progress!"

Filemaker is doing what you told it to do. There are probably much more efficient ways to do this, by using applescript effectively, or by doing a standard import at Vaughan suggests. But we can't help you much if we can't see the script. FileMaker does NOT have to display data or come to the front when creating records with applescript.

  • Author

Filemaker is doing what you told it to do. There are probably much more efficient ways to do this, by using applescript effectively, or by doing a standard import at Vaughan suggests. But we can't help you much if we can't see the script. FileMaker does NOT have to display data or come to the front when creating records with applescript.

I have to admit I never looked into whether Import might be a good way to do this.

I'm attaching the Applescript main loop and related subroutines, as well as the two FM scripts that are invoked.

I noticed that, by commenting out both the calls to

do script gFMPSpecialCasesScript

...and...

writeFMPItems(myLastOrderNumber)

from the main loop, I was able to prevent the "come to front" problem from happening.

By the way, writeFMPItems() calls a FM script that populates repeating fields, if that helps...;.

I hope this gives you a little more to go on.

Thanks,

Chap

Archive.zip

  • Author

An update: I commented out the two calls from Applescript to FM scripts, and the script ran fine "in the background". So apparently there's something in those two FM scripts that makes FM want to come to the foreground.

Yes, running scripts will bring Filemaker to the front. Pretty sophisticated scripting, looks good. Have you considered using some sort of flag field and running the filemaker script after all the data is in place? Also, wondering why you're using repeats.

  • Author

Yes, running scripts will bring Filemaker to the front.

Oh, well, now I know!

Also, wondering why you're using repeats.

The old story: I was hired as a consultant to enhance an existing system. Once this is done the contract may be extended to do a thorough overhaul. Bye-bye repeating fields!

Thanks for your help!

Chap

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.