Originally Posted by
opus_az
I have one script that calls another script:
code:
do shell script "open /path/to/otherscript.app"
I'd like the first script to wait until the otherscript.app finishes.
I've experimented with the wait command but can't get it working.
The delay command seems a bit inelegant.
In order for wait to function as you'd expect, the script needs to "fork-off" some
background job(s) which run(s) as child process(es). The way to do that in a pure
shell script is to put an
ampersand on any lines which spawns such subprocesses:
#!/bin/bash
/path/to/some/command &
/path/to/another/command &
wait # waits for all of the above threads to terminate before continuing.
But since AppleScript is involved here, I'm not sure exactly how to do that.
(I'm basically just trying to clear up how "wait" is supposed to work). But...
if using AppleScript isn't vital to the task at hand, I'd say maybe try doing
the whole thing in Bash.