Is this possible? I have files in multiple folders on a server. I need copies of the files copied to other folders on the server. However, heres the tricky part- the new folder paths are based on the paths of the original location. For example- File1.jpg is in Server1/Folder1/Subfolder1 /Subsubfolder1 and it needs to be copied to Server1/Folder2/Subfolder1/Subsubfolder1
So only a slight change exists in the new path, AND if the new path doesn’t exist, it’d be great to be able to get a warning dialogue box and then an option to either stop there or create the new folders.
try this, the intermediate directories will be created automatically
property folder2 : "Folder2"
set sourceFile to POSIX path of (choose file)
set TID to text item delimiters
set text item delimiters to "/"
tell text items of sourceFile to set destinationFile to ({items 1 thru 2} & folder2 & items 4 thru -1) as text
set text item delimiters to TID
do shell script "/usr/bin/ditto " & quoted form of sourceFile & space & quoted form of destinationFile
property folder1 : "Original"
property folder2 : "Retouched"
set sourceFile to POSIX path of (choose file)
set TID to text item delimiters
set text item delimiters to folder1
set t to text items of sourceFile
set text item delimiters to folder2
set destinationFile to t as text
set text item delimiters to TID
do shell script "/usr/bin/ditto " & quoted form of sourceFile & space & quoted form of destinationFile