Synchronising Filemaker and Applescript

I have an AppleScript that tells FileMaker to execute a FileMaker script.

However, I have realised that the AppleScript does not wait for the FileMaker script to finish before continuing on. Needless to say, since the script goes on to manipulate the files produced by FileMaker, this is not satisfactory!!

Here is an example:

	tell application "FileMaker Pro"
		open activeuni_file
		do script FileMaker script "Export current enrollments"
	end tell
	say "Finished FileMaker enrollments script" with waiting until completion
	

With this code, FileMaker begins to execute the script, then AppleScript immediately says the text. Other AppleScript will also be executed, and even commands to other applications.

The only thing that seems to make it wait until FileMaker is finished is another instruction to FileMaker.

Is there some way to make the AppleScript wait until FileMaker is finished? (Other than putting “delay 600” after it)

BTW, I discovered that the script editor allows me to add “with waiting” or “without waiting” to the end of the “do script FileMaker script” command, but it did not seem to make any difference.

Hi,

use the statement “perform applescript” in filemaker-scriptmaker at the end of your exportscrip, in there, you put the code that should wait for execution until the export completes.