Re: Copying files via applescript
Re: Copying files via applescript
- Subject: Re: Copying files via applescript
- From: Brian Dent <email@hidden>
- Date: Thu, 10 Jun 2004 10:54:12 -0700
Thanx for the help. the script worked just fine except i realized that it doesn't copy the files in subfolders of the folder.
Here is what i tried.
if (folder srcFolder exists) then
if (folder destFolder exists) then
repeat with i from 1 to count of items of folder srcFolder
set theItem to item i of folder srcFolder
set checkFile to (destFolder as string & (name of theItem)
if ((file checkFile) exists) then
if ((modification date of file checkFile) is less than (modification date of theItem)) then
duplicate theItem to folder destFolder
-- here is what i added
else if ((folder checkFile) exists) then
if ((modification date of folder checkFile) is less than (modification date of the item)) then
duplicate theItem to checkFile
end if
end if
end repeat
end if
end if
it works fine for copying the files but throws an error when it encounters a folder.
the event log shows:
get item 9: folder "Lab13"
get name of folder "Lab13" ....: "Lab13"
exists file ....: false
exists folder...: true
get mod date of folder "LEXAR MEDIA:...:Lab13": date "Monday May 31...
get mod date of folder "Lab13:...": date "Thursday June 10...
copy folder "Lab13"... to folder "LEXAR MEDIA:...:Lab13:": FINDER GOT AN ERROR
i had tried putting folder theItem or folder checkFile in the duplicate command
and
duplicate theItem to ((destFolder as string) & checkFile & ":")
I guess basically it needs to copy over the entire contents of the folder and its subfolders.
plz help
_______________________________________________
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.