Re: backup
Re: backup
- Subject: Re: backup
- From: Graff <email@hidden>
- Date: Mon, 19 Apr 2004 14:53:29 -0400
On Apr 19, 2004, at 7:35 AM, Paula Pierce, HostingCT.com wrote:
I don't know a thing about Applescript, but I would like to have a
script that would do the following:
1. Create new folder on desktop
2. Call it backup
3. Copy specific files/folders into it
Then I can simply burn it to disk. That way I think I'll backup my
files more often!
Here's a sample script that does what you say:
----------
set itemList to {"Some:path:to:file", "Some:path:to:file2"}
set backupLocation to (path to desktop as string)
set backupName to "Backup"
set backupFolder to backupLocation & backupName
tell application "Finder"
if not (exists folder backupFolder) then
make new folder at backupLocation with properties {name:backupName}
end if
repeat with theItem in itemList
if (exists file theItem) then
duplicate file theItem to folder backupFolder with replacing
end if
end repeat
end tell
----------
You just add strings to the variable itemList and the script will get
each of those files and copy them to the folder "Backup" which will be
on the desktop. If you want to change the name or location of the
backup file then just change the appropriate variable at the top of the
script.
I put in some basic error checking so the script won't break if you
move a item that you put in the list to be copied.
- Ken
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >backup (From: "Paula Pierce, HostingCT.com" <email@hidden>) |