• 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: backup script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backup script


  • Subject: Re: backup script
  • From: Jolly Roger <email@hidden>
  • Date: Mon, 12 Feb 2001 18:23:26 -0600
  • Replyto: email@hidden

on 2/12/2001 6:07 PM, B. H. (email@hidden) wrote:

> I am writing a script to backup a folder onto a disk, the problem is that
> the same item exists on the disk. How can I get the new file from the HD to
> replace the pre-existing one on the disk?

That's not much information to go on; but I'll guess you are using the
Finder's "duplicate" command to perform the copy.

If so, then take a look at the Finder dictionary by dragging the Finder icon
on top of your script editor. You will see the the duplicate command has
these parameters:

duplicate : Duplicate one or more object(s)
duplicate reference -- the object(s) to duplicate
[to location reference] -- the new location for the object(s)
[replacing boolean] -- Specifies whether or not to replace items in
the destination that have the same name as items being duplicated
[routing suppressed boolean] -- Specifies whether or not to
autoroute items (default is false). Only applies when copying to the system
folder.
Result : reference -- to the duplicated object(s)

So then, the following will copy the files to the disk and replace any
existing files on the disk:

tell application "Finder"
duplicate myFile to zipDisk with replacing
end tell

HTH

JR


  • Follow-Ups:
    • Re: backup script
      • From: Mr Tea <email@hidden>
References: 
 >backup script (From: "B. H." <email@hidden>)

  • Prev by Date: RE: scripting terms (attachability)
  • Next by Date: Accessing a Record by variable
  • Previous by thread: backup script
  • Next by thread: Re: backup script
  • Index(es):
    • Date
    • Thread