• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best way to tell if a file copy has finished.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to tell if a file copy has finished.


  • Subject: Re: Best way to tell if a file copy has finished.
  • From: Jeff Porten <email@hidden>
  • Date: Mon, 15 Aug 2005 22:49:43 -0400

On Aug 2, 2005, at 7:58 AM, email@hidden wrote:

I have a script that must process files that appear in a folder, they are copied there from another mac across the network. I've seen a couple of methods for this in scripts I've found on the web. I did have one method that seemed to work well under Panther but it doesn't work under Tiger....

Under Tiger I have found that the file size remains at zero until the file has finished copying, so my script now loops while the file size is zero.

If I'm understanding the question right, you want your script to wait until a copy has completed before going on to something else. That's the default, so just use a Finder copy and tell AppleScript to wait patiently for it to finish.


tell application "Finder"

    (* some script steps *)

    with timeout of 86400 seconds -- hasta maƱana
        duplicate srcFile to destFolder
    end timeout

    (* more script steps *)

end tell

With the huge timeout, AppleScript won't proceed until Finder signals that the copy is completed. Now, if your network connection is buggy and the copy fails entirely, this script isn't going to figure that out until tomorrow. Solving that is another problem....

Best,
Jeff


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Best way to tell if a file copy has finished.
      • From: Christopher Nebel <email@hidden>
References: 
 >Best way to tell if a file copy has finished. (From: email@hidden)

  • Prev by Date: Re: SetVisibleInTiger
  • Next by Date: Re: How to determine whether launched automatically at login
  • Previous by thread: Best way to tell if a file copy has finished.
  • Next by thread: Re: Best way to tell if a file copy has finished.
  • Index(es):
    • Date
    • Thread