Error when duplicating files

Hello,

I am trying to shorten a script I was running before and I am getting an -8082. The error is with the duplicate command.

Would someone have an idea why?

Your help is greatly appreciated.

Daniel

set HomeFolder to (path to home folder as text)

set pathFolder1Name to "ZVinformatique"
set pathFolder2Name to "MPEGfiles"
set DestinationFolder to (path to home folder as text) & pathFolder1Name & ":" & pathFolder2Name & ":" --"ZVinformatique:MPEGfiles:"
set POSIXdestinationFolder to POSIX path of DestinationFolder


tell application "System Events" to tell property list file ((path to preferences folder as string) & "ViI.plist")
	set aMasterDisk to value of property list item "DUMPNX5U"
end tell

if aMasterDisk is equal to "SAN" then
	set DestinationFolder to "Data:" & pathFolder1Name & ":" & pathFolder2Name & ":" --"ZVinformatique:MPEGfiles:"
	set POSIXdestinationFolder to POSIX path of DestinationFolder
end if

set POSIXdestinationFolder to POSIX path of DestinationFolder

set logFolder to (path to home folder as text) & pathFolder1Name & ":CompétitionCourante:"

set cardMPEGFolder to "MP_ROOT:101PNV01:"
set cardVolume to "NX5U"
set NX5Ufolder to "Volumes:" & cardVolume & ":" & cardMPEGFolder & ":" --"NX5U:MP_ROOT:101PNV01:"
set POSIXNX5Ufolder to POSIX path of NX5Ufolder

set cardPLISTFolder to "MP_ROOT:"
set NX5UPLISTfolder to "Volumes:" & cardVolume & ":" & cardPLISTFolder --"NX5U:MP_ROOT:"


tell application "Finder"
	with timeout of 0 seconds
		set SourceFolder to folder cardMPEGFolder of disk cardVolume as string
		set theCardFiles to files of folder SourceFolder
		duplicate theCardFiles to folder DestinationFolder with replacing
		
		
		set VideoComp to count of (files in folder "MP_ROOT:101PNV01:" of disk "NX5U" whose name extension is "mpg")
		if VideoComp is not equal to 0 then
			if not (exists folder ("MP_ROOT:SAUVEGARDE") of disk cardVolume) then
				try
					set ERREUR to "No"
					do shell script "mkdir Volumes/" & cardVolume & "/MP_ROOT/SAUVEGARDE/"
				on error errMsg number errorNumber
					display dialog "IMPORTANT - Erreur lors de la création du dossier NX5U/MP_ROOT/101PNV01/SAUVEGARDE sur la carte SDHC. Veuillez vérifier que le le locquet de sécurité est désactivé. Pour tout autre problème, veuillez en informer avec votre administrateur, erreur #" & errorNumber as text giving up after 300
				end try
				
			end if
			
			---
			-- MOVING files to folder SAUVEGARDE on SDHC card
			---
			set abcde to "mv Volumes/NX5U/MP_ROOT/101PNV01/M2U0*.* Volumes/NX5U/MP_ROOT/SAUVEGARDE/"
			try
				do shell script abcde
			on error errMsg number errorNumber
				
				display dialog "IMPORTANT - Erreur lors du transfert des données de la carte SDHC NX5U/1011PNV01 vers le dossier NX5U/MP_ROOT/101PNV01/SAUVEGARDE. Veuillez en parler avec votre administrateur, erreur #" & errorNumber as text giving up after 300
				return
			end try
			
			
			---
			-- Trasnferring video files from the SDHC card has been completed succesfully. The SDHC card will now be ejected.
			---		
			set mountedDisks to list disks
			if mountedDisks contains "NX5U" then
				eject disk "NX5U"
			end if
			repeat until mountedDisks does not contain "NX5U"
				set mountedDisks to list disks
			end repeat
			
			
		else
			display dialog "Veuillez prendre note que la carte SDHC ne contient aucun fichiers vidéos. L'opération est alors interrompu!"
			
			set mountedDisks to list disks
			if mountedDisks contains "NX5U" then
				eject disk "NX5U"
			end if
			repeat until mountedDisks does not contain "NX5U"
				set mountedDisks to list disks
			end repeat
			return
		end if
		
	end timeout
end tell

Hi,

at first glance: All POSIX file paths must start with a slash, for example


 set abcde to "mv /Volumes/NX5U/MP_ROOT/101PNV01/M2U0*.* /Volumes/NX5U/MP_ROOT/SAUVEGARDE/"

And all HFS paths must start with a disk name and external volumes must not start with Volumes, for example


set NX5Ufolder to "cardVolume & ":" & cardMPEGFolder & ":" --"NX5U:MP_ROOT:101PNV01:"
set POSIXNX5Ufolder to POSIX path of NX5Ufolder

Thanks Stefan,

I will make this change to the script.

This is really bizarre, I’ve took that script and copied it onto another computer and it work flawlessly.

There are things which are hard to understand sometime.

with regards!
Daniel