Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thriftinkid

macrumors regular
Original poster
Mar 24, 2008
119
0
I'm writing a script that moves a group of files around (copying from folder to folder, moving from folder to folder, uploading to FTP server,etc). The problem is that the script tries to move on to the next command before the files are done moving, copying, etc. Does anyone know how to write a script to tell the script to wait until the action is done before moving on to the next step, or know where I can find help? Sorry if this is easy, but I know nothing about writing code. Any help would be greatly Appreciated. Thanks for dealing with me.
 
Preferrably Applescript because that is what I have been picking up the most, but shell script is ok too.

In shell scripts, the command is 'wait'. :)

I am not sure exactly how one would do it in Applescript though.
 
In shell scripts, the command is 'wait'. :)

I am not sure exactly how one would do it in Applescript though.

In a shell script you shouldn't need to call wait - unless you are forking commands they will block until they are completed.
 
In a shell script you shouldn't need to call wait - unless you are forking commands they will block until they are completed.

True... I just figured I would make the information available at least. Forgot to mention that part.

It is a godsend in my command-line Handbrake scripts, though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.