you guys are really help full
please help me again
i want a simple script that duplicate and move all the files from one folder to another.
thats not all
it should duplicate and move all the files from the sub and sub folder of that main folder to another folder.
is that not possible
I know how to duplicate and copy files from one folder to another but I want to know is that possible to duplicate and copy all the files from the folder and its sub folder to another folder.
It’s probably possible but you might need to provide more details to get a useful response.
I think alnoor want to do a recursive recursive copy but there are just two cases :
copy sourcedir/* destdir
and copy sourcedir destdir.
I’d be curious get the anwers for the two even if I suspect that for the second if it is asked to the finder it’s just like copy one file. Another solution would be using do shell command (with CpMac?).
o.k let me explain
I have a folder name “aaa”
the folder “aaa” has two sub folders named as “bbb” and “ccc”
now folder "bbb"has two sub folders named as “ddd” and “eee”
and folder "ccc"has two sub folders named as “fff” and “ggg”
So in short “aaa” folder has two sub folder and that two sub folders have two more sub folders.
These all sub folders “bbb”,“ccc”, “ddd”, “eee”, “fff”, “ggg” has got many files inside it.
Now i want to duplicate all files from “aaa” folder and its Subs folser to another folder
Ok, this might work. You need to consider what you want to do if there is more than one file with the same name. This is the issue that is most likely to trip the error dialog.
tell application "Finder"
set files_ to files of entire contents of folder "path:to:aaa:"
repeat with file_ in files_
duplicate file_ to folder "path:to:xxx:"
on error e
display dialog e
thanks rob it works for me
but its too slow
i was thinking if i can speed up the process by just moving the files instesd of duplicating.
do you have any suggestions
Did you try to change ‘duplicate’ to ‘move’ in the script?
i don,t know for some reason ‘move’ dosn’t work for me in first attempt.
But after your reply it works.
Thank once again