Sign in to follow this  
Followers 0

problem with a variable

1 post in this topic

#1 ·  Posted (edited)


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:

$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
; Envoie le chemin du fichier
    WinWait("", "", 3)
; Attendre que ce soit fait 
    WinWait("", "", 10)
; Fermer Adobe Reader
; Se mettre dans notepad
    WinWaitActive("Untitled - Notepad")
; Colle
; Va dans le menu Fichier
    WinWait("", "", 3)
; Va sur Enregistrer sous
    Send("{DOWN 3}")
; Tape le nom du nouveau fichier
    WinWait("", "", 3)
; Valide le nom du fichier
; Ferme le notepad
    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.

Thanks in advance,


Edited by pandelis

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0