Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7422 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

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

This topic is 7422 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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