on copyFile(fileAlias, targetAlias, newFileName)
-- fileAlias is an alias to the source file, targetAlias is an alias to the destination folder and newFileName is a string
set sourcePath to (quoted form of POSIX path of (fileAlias as text))
set targetPath to (quoted form of (POSIX path of ((targetAlias as text) & newFileName)))
try
do shell script "cp -np " & sourcePath & space & targetPath
on error errText number errNr
display dialog "Error cp -np = " & errNr & return & errText
error number -128 --***********************
end try
try
return ((targetAlias as text) & newFileName) as alias
on error errText number errNr
display dialog "Error targetAlias = " & errNr & return & errText
error number -128 --***********************
end try
return {}
end copyFile --------------------------------------------------------------------