Help required with 'mv ' query...

Hi there,
Please can someone point me in the right direction.

If I try and move a single file, using the method below, I get the error ‘No such file or directory’?


set myFile to "theFilename.pdf"

set theSource to "/Volumes/thisVolume/thisFolder/thisSubfolder/Processed/" & myFile
set theTarget to "/Volumes/thisVolume/thisFolder/thisSubfolder/TIDY-UP/"

do shell script "mv " & (quoted form of theSource) & " " & (quoted form of theTarget)

I’ve tried a number of variations including building the ‘mv’ instruction into a variable to try and see what’s happening.

I’m trying to move the file(s) of a folder, on a network drive, to another folder on the same drive.

Thanks in advance.

EDIT: Code edited as per Stefan’s comment re src and theSource

Hi,

the code is supposed to work (apart from the differences theSource - src).

Consider that mv really moves the file that means the source file is deleted after the operation.
So if you try it twice, the source is gone.
No such file or directory can be the source or the destination.

Hi Stefan,

Thanks for the help, it highlighted something wrong with a directory.
The file was being moved to the level above hence the ‘No such file or directory’.

Thanks again Stefan.