move file to server or copy original file after it was copied?

Hallo everybody,

I use the following line…


tell application "Finder" to move sourceFile to targetFolder without replacing

…to move a file to a folder on a smb NAS.
It makes no difference if I use ‘move’ or ‘copy’ - the original file is sustained.

Question:
I really would like to delete the original file in the source folder.
I tried it by simply adding ‘delete’


tell application "Finder" to move sourceFile to targetFolder without replacing
delete

But it doesn’t work.

Does anybody know a simple way to really -move- the file or to copy the original file after it was copied to the smb server?

I’ve found some workarounds in the forum and they used shell script.
But I’d like to avoid shell script and would prefer to do it directly with AppleScript.

Can anybody help?
Thanks
Carl

Hi,

moving to external disks (and servers are external disks) is equivalent to duplicate operation of Finder. You should delete source file as you did, but other way:


tell application "Finder"
	move sourceFile to targetFolder without replacing
	delete sourceFile
end tell

Thank you, works like a charm