try
tell application "Finder"
duplicate folder "Data:Configuration:Images:" to folder "Data:Logs:"
end tell
end try
Using the code above, i can copy the folder “Images” to “Data:Logs”
Now, the question is, what should i do if folder “Images” is invisible? how do i copy it to folder “Data:Logs”?
Need help.
You could try something like this. Of course, you will need to adjust the path names according to your requirements.
set srcfolderpath to "Macintosh HD:Users:martin:Desktop:source:"
set dstfolderpath to "Macintosh HD:Users:martin:Desktop:dest:source:"
set command to "ditto " & quoted form of (POSIX path of srcfolderpath) & space & quoted form of (POSIX path of dstfolderpath)
do shell script command
change of question, i got the script to run but copies were not made.
do i need to include the . before an invisible folder? actually, i tried it and it copied the contents of the folder. how do i make it so that it copies the folder itself and not just the contents?
maybe i don’t know how to use the code, i’m trying to copy the folder LogImages to Data:Logs: the code used is written below.
set logImageSrc to "Data:Configuration Folder:LogImages:"
set logImageDst to "Data:Logs:"
set command to "ditto " & quoted form of (POSIX path of logImageSrc) & space & quoted form of (POSIX path of logImageDst)
do shell script command
is what im doing with the code you posted right? thanks a lot
I think this would be better, as it also creates the corresponding folder name in the destination folder:
set logImageSrc to "Data:Configuration Folder:LogImages:"
set logImageDst to "Data:Logs:LogImages:"
set command to "ditto " & quoted form of (POSIX path of logImageSrc) & space & quoted form of (POSIX path of logImageDst)
do shell script command
Are the following folder paths absolute paths or relative paths? You need to use absolute paths to successfully copy the folders!
set logImageSrc to "Data:Configuration Folder:LogImages:"
set logImageDst to "Data:Logs:LogImages:"