Jump to content

tell FM to wait for a "do script" to be finished?


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

Recommended Posts

Hi to all,

how can I tell FileMaker or Applescript to wait until a AppleScript "do script" subroutine is finished?

If it runs alone it`s perfect, integrated into a FileMaker script, FileMaker executes the next commands without waiting for the "do script"-routine to be finished.

Any suggestions??

Thanks!

Link to comment
Share on other sites

Filemaker Script A runs the Applescript as its last statement.Applescript B runs Filemaker Script C as its last statement. Filemaker Script C finishes the procedure.

Hmm Mr. Knippel, thanks...

but I'm not sure if I understood it right...

You mean I should split the AppleScript? If yes, then it doesn't work, because the "do script"-subroutine returns values (globals) that are needed within the whole script in a loop, so it would be extremely difficult to split the whole stuff. Or did I understand it wrong?

I would appreciate your answer very much!

Perfect would be a method which allows to wait until the subroutine is finished.

Link to comment
Share on other sites

Anything can be split into sub-scripts. If you are within a loop and you cannot break the loop in order to start and stop the scripts, you could have Filemaker pause for a set period of time, then check the status of the globals. If the Applescript has populated them, then Filemaker will exit this wait loop, otherwise it will pause again, and so on.

However I had to do this for a client once and the only way to insure that the OS controlled script (the Applescript) completed successfully and correctly was to break up the script and have A call B which calls C. This way one cannot complete without the previous one completing.

Link to comment
Share on other sites

This topic is 7888 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.