Jump to content
Sign in to follow this  
Carlos F

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

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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