1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Wait Command

Discussion in 'Mac Programming' started by thriftinkid, Apr 9, 2008.

  1. macrumors regular

    #1
    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.
     
  2. macrumors 6502

    #2
    What kind of script? Shell script, AppleScript ....
     
  3. macrumors regular

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

    Krevnik

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

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

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

    Krevnik

    #6
    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.
     

Share This Page