Re: backup script
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