Oh - that's broken it. Seems to be introducing a ' into the first file path:
[ 1 ] ditto: can't get real path for source ''/Volumes/Online_DAM'/1/00/02/0002c5d0-185e-4404-8837-eb50e89cd52c/source/UK_AUT17_002_ENG_A-board_2_v 01_Folder.zip'
when I replaced the ditto with this:
do shell script "ditto " & sPath'squoted form & space & nPathpassword "xxxxxx" with administrator privileges
====
property server_path : "/Volumes/Online_DAM"
property new_path : server_path & "/NewFS/"
-- property server_path : "/Volumes/A_Utility/ASTest"
-- property new_path : "/Volumes/A_Utility/VikingPath/"
property delim : ","
property isDesktop : (path to desktop as text) as alias
property csv : {"public.comma-separated-values-text", "public.delimited-values-text"}
set msg to "Choose the input CSV file:"
set rowItems to {}
-- prompt for CSV file and read its contents by row into a list
set csvfile to (choose filewith promptmsgof typecsvdefault locationisDesktop without invisibles, multiple selections allowed and showing package contents)
set csvdata to (read csvfile as «class utf8» using delimiter linefeed) as list
repeat with aRow in csvdata
-- get a list of this CSV row items split on delimiter
set rowItems to my parseCSV(aRow, delim)
-- sPath becomes the source path and filename
set sPath to quoted form of server_path & first item of rowItems & middle item of rowItems
-- make any uppercase words into titlecase in destination path
set x to do shell script "ruby -e 'puts ARGV.first.gsub(/\\w+/, &:capitalize);' " & last item of rowItems
-- nPath becomes the new_path and appended destination folder
set nPath to new_path & x
-- make the folder path hierarchy if it doesn't exist, otherwise do nothing
do shell script "mkdir -p " & nPathpassword "xxxxxx" with administrator privileges
try
-- ditto will copy all existing file attributes to the destination
do shell script "ditto " & sPath'squoted form & space & nPathpassword "xxxxxx" with administrator privileges
on error errmsg number errnbr
my error_handler(errnbr, errmsg)
return
end try
end repeat
return
on parseCSV(rowText, adelim)
-- split the supplied CSV row on its delimiters. Return quoted list elements.
set {TID, AppleScript'stext item delimiters} to {AppleScript'stext item delimiters, adelim}
set rowItems to text items of rowText
set AppleScript'stext item delimiters to TID
return rowItems as list
end parseCSV
on error_handler(nbr, msg)
return display alert "[ " & nbr & " ] " & msg as critical giving up after 10
end error_handler