Shell scripts and getting data back question

Not sure if I worded that header correctly but I am transferring some folders from the network to local hard drives using cp and I have a couple of issues:

here’s the shell script I am using:

do shell script "cp -R -v " & POSIX path of thisFolder & " " & POSIX path of theBurnFolder

According to the cp manual -R does this:

If source_file designates a directory, cp copies the directory and the entire subtree connected
at that point. This option also causes symbolic links to be copied, rather than indirected
through, and for cp to create special files rather than copying them as normal files. Created
directories have the same mode as the corresponding source directory, unmodified by the process’
umask.

The user would be selecting the folders to transfer and the hierarchy looks like this:

burnFolder:
12345_Folder <–user selects this one
beauty <–sub folders
product

so -R should move the folder 12345_Folder and all sub folders within it, right? But what I am getting is just the sub folders.

Also, the user will be selecting multiple folders, the shell script will be in a repeat that loops through each folder to move, how would I be able to display to the user what is going on? i.e. 12345_Folder is now being moved…

I thought -v would allow for that but I couldn’t get anything returned.

Thanks for the help.

Hi,

a little, but significant difference

do shell script "/bin/cp -R ~/Desktop/myFolder/ ~"

copies all subfolders of the folder myFolder on desktop to the current home folder

do shell script "/bin/cp -R ~/Desktop/myFolder ~"

copies the folder myFolder on desktop and all subfolders to the current home folder

the -v(erbose) flag prints (the path of) every copied item to standard output, nothing else

Drop the trailing slash.

Example:

choose folder with prompt "Copy this folder:"
set thisPath to text 1 thru -2 of POSIX path of result

choose folder with prompt "Create copy in this folder:"
set destinationPath to quoted form of POSIX path of result

set prevTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to "/"
set thisName to last text item of thisPath
set text item delimiters of AppleScript to prevTIDs

-- set content of text field "something" of whatever to "Moving " & thisName
do shell script "/bin/cp -R " & quoted form of thisPath & " " & destinationPath