► Afficher le texte
Code : Tout sélectionner
#include<_FileListToArrayNew2h.au3>
Dim $vrdatfch, $indice, $var_Array, $vrRepSource
$vrRepSource = FileSelectFolder("Sélectionnez le dossier contenant les photos ou images à ajouter dans votre galerie", " ")
If $vrRepSource = "" Then
MsgBox(0,"Info","Vous n'avez pas choisi de dossier, création de la galerie anulée")
exit
Else
Endif
If FileExists(@DesktopDir & "\Photos_triées") Then
Else
DirCreate (@DesktopDir & "\Photos_triées")
EndIf
$var_Array = _FileListToArray3 ($vrRepSource, "*.jpg", 1, 0, 1,"Temp|TMP")
For $indice = 1 to $var_Array[0]
$vrdatfch = FileGetTime($var_Array[$indice], 1)
If Not @error Then
If FileExists(@DesktopDir & "\Photos_triées"&"\"&$vrdatfch[2]&"-"&$vrdatfch[1]&"-"&$vrdatfch[0]) Then
Else
DirCreate (@DesktopDir &"\Photos_triées"&"\"&$vrdatfch[2]&"-"&$vrdatfch[1]&"-"&$vrdatfch[0])
EndIf
FileCopy($var_Array[$indice], @DesktopDir & "\Photos_triées\" & $vrdatfch[2] & "-" &$vrdatfch[1] & "-" &$vrdatfch[0] & "\", 9)
Endif
Next
MsgBox(0,"Info","Voila, vos photos sont maintenant triées dans un dossier sur votre bureau")