Wait Command

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

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #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

    Joined:
    Jun 1, 2006
    #2
    What kind of script? Shell script, AppleScript ....
     
  3. thread starter macrumors regular

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

    Krevnik

    Joined:
    Sep 8, 2003
    #4
    In shell scripts, the command is 'wait'. :)

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

    Joined:
    Jun 1, 2006
    #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

    Joined:
    Sep 8, 2003
    #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