PDA

View Full Version : Wait Command




thriftinkid
Apr 9, 2008, 04:15 PM
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.



antibact1
Apr 9, 2008, 04:25 PM
What kind of script? Shell script, AppleScript ....

thriftinkid
Apr 9, 2008, 04:55 PM
What kind of script? Shell script, AppleScript ....

Preferrably Applescript because that is what I have been picking up the most, but shell script is ok too.

Krevnik
Apr 9, 2008, 09:12 PM
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.

antibact1
Apr 9, 2008, 09:45 PM
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.

Krevnik
Apr 9, 2008, 10:36 PM
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.