Droplet to rename files

Trying to rename the four first characters of my jpeg files. I’m getting the following message when dropping on it:

Can’t set name of file…

Please Help

Here is my script

on open these_items
set prefixe to text returned of (display dialog “Inscrire le préfixe:” & return default answer “” buttons {“OK”} default button “OK”)
repeat with i from 1 to count these_items
set item_info to the info for item i of these_items
set nom_fichier to the name of item_info
set chemin_fichier_ori to item i of these_items as alias
set chemin_fichier to item i of these_items as string
display dialog "Nom du fichier: " & nom_fichier
display dialog "Nom du chemin + Fichier: " & chemin_fichier
– find path
set oldDelimiter to text item delimiters
set text item delimiters to “:”
set chemin_plus to text items of chemin_fichier
set nbre_rep to (count text items of chemin_plus) - 1
set chemin to text items 1 thru nbre_rep of chemin_plus as string
set text item delimiters to oldDelimiter
display dialog "Nom du chemin seulement: " & chemin
– modif filename
set nbre_car to number of characters of nom_fichier
set nouveau_nom_fichier to prefixe & characters 5 thru nbre_car of nom_fichier as string
display dialog "Nouveau nom du fichier: " & nouveau_nom_fichier
display dialog "Nom du chemin et nouveau nom de fichier: " & chemin & “:” & nouveau_nom_fichier
set name of file chemin_fichier_ori to nouveau_nom_fichier
end repeat
end open

You want:

tell application "Finder" to set name of file chemin_fichier_ori to nouveau_nom_fichier

Thank you Adam. It is working just fine.

Louis