c bon , c'est dans la poche, je donne le script au cas ou
Code : Tout sélectionner
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: yann
Script Function:
slide soirée scripto.
#ce ----------------------------------------------------------------------------
;init des variables
$dateplusrecent = 0
$fichierplusrecent = ""
$last = ""
$nb = 0
FileChangeDir("D:\tofo")
;liste des fichier au lancment
$search = FileFindFirstFile("*.JPG")
HotKeySet("²", "slide")
HotKeySet("{ESC}", "Terminate")
;;;; Body of program would go here ;;;;
While 1
Sleep(2000)
slide()
WEnd
Func lastFile()
$last = $fichierplusrecent
$nb = StringMid($last, 5, 4)
;MsgBox(4096, $fichierplusrecent, "je save cette image et le chiffre "&$nb)
EndFunc
Func newImg()
If FileExists("D:\tofo\DSC_"&$nb+1&".JPG") Then
SplashImageOn("Boo", "D:\tofo\DSC_"&$nb+1&".JPG" ,1920 ,1275 , "", "", 1)
Sleep(2200)
;SplashOff()
$nb = $nb+1
EndIf
EndFunc
Func slide()
;si pas de fichier trouvé, affiche image erreur
If $search = -1 Then
SplashImageOn("Boo", "d:\tofo\1\error.JPG" ,@DesktopWidth ,@DesktopHeight , "", "", 1)
Sleep(2200)
EndIf
$file = FileFindNextFile($search)
If @error Then
;MsgBox(0, "no photo", "clode")
FileClose($search)
Sleep(2200)
;MsgBox(0, "no photo", "reset")
$search = FileFindFirstFile("*.JPG")
$dateplusrecent = 0
lastFile()
EndIf
$datefichier = FileGetTime($file,0,1)
if $datefichier > $dateplusrecent then
$dateplusrecent = $datefichier
$fichierplusrecent = $file
SplashImageOn("Boo", $fichierplusrecent ,1920 ,1275 , "", "", 1)
Sleep(2200)
;SplashOff()
newImg()
EndIf
;MsgBox(0, "sortie", "while")
EndFunc
Func Terminate()
Exit 0
EndFunc
Merci encore pour l'aide donnée plus haut
