Automatically Extract ZIP

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Automatically Extract ZIP

23 Apr 2018, 15:15

i could not do:
Automatically Extract ZIP Files After Downloading

but
Automatically Extract ZIP After visiting Downlod folder

this helps:

Code: Select all


ifwinactice,r:\downloads
	loopFilesDownloadFolder()
return

loopFilesDownloadFolder(){
            Loop, Files, r:\downloads\*.*
            {
                  tooltip, % A_LoopFileLongPath
                  ; Clipboard := A_LoopFileLongPath   
                  lenLoopFileExt := StrLen(A_LoopFileExt)
                  folderDecZiped := SubStr( A_LoopFileLongPath ,1, -1 - lenLoopFileExt ) 
                  
                  if(A_LoopFileExt == "pdf" || ( A_LoopFileExt == "zip" && isDir(folderDecZiped))){
                        ;MsgBox,4 ,Titel, isDirectory("%folderDecZiped%") (from: %A_LineFile%~%A_LineNumber%), 5
                        ;FileMoveDir, Source, Dest [, Flag (2 = overwrite)]
                        
                        fileExtDir :=  A_LoopFileDir "\" A_LoopFileExt
                        if(!isDir(fileExtDir))
                              FileCreateDir,% fileExtDir

                        fileAddress := fileExtDir "\" A_LoopFileName
                        FileMove, % A_LoopFileLongPath, % fileAddress

                        ;if(A_LoopFileExt == "pdf")

                        if(A_LoopFileExt == "pdf"){
                              if(!WinExist("Abbyy")){
                                    ABBYY_FineReader_12_Professional := "r:\Program Files (x86)\_\ABBYY FineReader 12\AbbyySTI.exe"
                                    ABBYY_FineReader_12_Professional := "r:\ProgramData\Microsoft\Windows\Start Menu\Programs\ABBYY FineReader 12\Quick Tasks\Bilddatei in PDF.lnk"
                                    RunWait, ""%ABBYY_FineReader_12_Professional%"", , 
                                    sleep,3000
                                    ABBYYexportFolder := "r:\Users\Administrator\AppData\Local\Temp\FineReader12.00\sndtbbf1.pdf"
                              }
                              global fileAddressABBYYaddLast
                              fileAddressABBYYaddLast := file2ABBYY(fileAddress, fileAddressABBYYaddLast)
                        }

                        continue
                  } 
                  if( A_LoopFileExt == "zip" ) {
                        7za := "r:\Program Files\_\7-Zip\7z.exe"
                        command="%7za%" e "%A_LoopFileLongPath%" -o"%folderDecZiped%"
                        command="%7za%" x "%A_LoopFileLongPath%" -o"%folderDecZiped%"
                        ; clipboard := command
                        run,% command
                        ;msgbox,%command% ?????
                        continue
      }            }      
      return
}

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 64 guests