pandelis Posted May 22, 2006 Posted May 22, 2006 (edited) Hi, I try to do a simple script: It should open all the pdf files in a folder, select all the text, copy it in the notepad and save this with the name of the pdf file. For doing this I used the FileFindFirstFile.au3 from Valuater (thanks !!!) Nevertheless when I want to save the file, it always paste the same wrong truncated name of one of my pdf file. Would you have any idea, please? Here is my script: expandcollapse popup$search = FileFindFirstFile("*.pdf") ; file find first file of all files in the directory. ; Check if the search was successful. If $search = -1 Then; if the variable, search equals negative one, then, MsgBox(0, "Error", "No files/directories matched the search pattern"); a message box will appear. Exit; and then exit the program. EndIf; ends an, if, statement. While 1; while, is a loop waiting for an action. $file = FileFindNextFile($search); finds the, next file, from the original search. $chemin = "L:\02 Lexique 3\01 Corpus\Metro\" ; Option j'ouvre Reader puis la fenĂȘtre d'ouverture de fichiers Run("C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe") WinWaitActive("Adobe Reader") ; Ouvre la fenĂȘtre de navigation Send("^o") ; Envoie le chemin du fichier Send($chemin) Send($file) Send("{ENTER}") WinWait("", "", 3) Send("^a") Send("^c") ; Attendre que ce soit fait WinWait("", "", 10) ; Fermer Adobe Reader Send("!{F4}") ; Se mettre dans notepad Run("C:\Windows\system32\notepad.exe") WinWaitActive("Untitled - Notepad") ; Colle Send("^v") ; Va dans le menu Fichier WinWait("", "", 3) Send("!f") ; Va sur Enregistrer sous Send("{DOWN 3}") ; Tape le nom du nouveau fichier Send($file) WinWait("", "", 3) ; Valide le nom du fichier Send("{ENTER}") ; Ferme le notepad Send("!{F4}") WinWait("", "", 10) ;MsgBox(4096, "File:", $file); message box to display the file that was found. WEnd; returns to the while, loop. ; Close the search handle. FileClose($search) Thanks in advance, Boris Edited May 22, 2006 by pandelis
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now