August 23, 200223 yr 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!
August 23, 200223 yr 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.
August 23, 200223 yr Author 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.
August 24, 200223 yr 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.
Create an account or sign in to comment