on adding folder items to Mon_Dossier after receiving Liste_Fichiers
   
    tell application "Finder"
       
        set Fimage to {"jpg", "jpeg", "png", "tiff", "gif", "bmp", "psd"} -- liste des extensions a traiter dans Fimage avec fonction mdls
       
        -- traitement des fichiers :
        set les_fichiers to files of Mon_Dossier --récupère tous les fichiers du dossier
        repeat with chaque_fichier in les_fichiers -- répète avec chaque fichier du dossier en cour
            -- traitement d'un fichier
            tell application "Finder"
                set nom to name of chaque_fichier --récupère le nom du fichier
                set AppleScript's text item delimiters to {"."} -- defini le separateur
                set lextension to get last text item of nom -- recupère l'extension
                set lefichier to chaque_fichier as string --récupère le chemin du fichier au format chaine de caractères
               
               
                if lextension is in Fimage then -- si fichier video de la liste Fimage
                   
                    set lahauteur to do shell script "mdls -name kMDItemPixelHeight " & quoted form of POSIX path of lefichier --récupère la hauteur pixel format mdls
                    set lalargeur to do shell script "mdls -name kMDItemPixelWidth " & quoted form of POSIX path of lefichier --récupère la largeur pixel format mdls
                    set AppleScript's text item delimiters to {" "} -- defini le separateur
                    set lahauteur to last text item of lahauteur
                    set lalargeur to last text item of lalargeur
                    set lechemin to POSIX path of lefichier
                   
                    if lalargeur > lahauteur then
                        set cadre to lalargeur * 0.007
                        set lacommande to "sips -Z " & lalargeur & " -p " & (lahauteur + cadre) & " " & (lalargeur + cadre) & " --padColor 000000 -i " & quoted form of lechemin
                    else
                        set cadre to lahauteur * 0.04
                        set lacommande to "sips -Z " & lahauteur & " -p " & (lalargeur + cadre) & " " & (lahauteur + cadre) & " --padColor 000000 -i " & quoted form of lechemin
                    end if
                    do shell script lacommande
                   
                end if
               
            end tell
        end repeat -- fichier suivant
    end tell
end adding folder items to
tell application "Finder"
    activate
    (display dialog ("waouou ... Ca y est c'est fait !") buttons {"Salut !"})
end tell