Advertisement
StavenCross

Untitled

Oct 3rd, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ButtonGrabSummary:
  2. For wb in ComObjCreate("Shell.Application").windows  
  3.       If InStr(wb.LocationName, name) && InStr(wb.FullName, "chrome.exe" )  
  4.         Break ; Break loop, just one way to keep this pointer in wb
  5. url=https://apps.dealer.com/analytics/as/samesfordfd/samesfordfd-admin/report/executive-summary/pdf?endDate=2017-09-30&startDate=2017-09-01
  6. loginurl=login.dealer.com
  7. wb.navigate(url)
  8. ReportFunction(Directory, Changes) {
  9.  For Each, Change In Changes {
  10.        Action := Change.Action
  11.        Name := Change.Name
  12.  
  13. If (Action = 1){
  14.       MsgBox,File Downloaded
  15. Loop, C:\users\%A_UserName%\Downloads\*.pdf  
  16. {
  17. If (A_LoopFileTimeCreated>Rec)                  ;If the time of file created is greater discard the other one in memory
  18.   {
  19.   FPath=%A_LoopFileFullPath%
  20.   Rec=%A_LoopFileTimeCreated%
  21.   MsgBox, Newest File %Fpath%
  22.  
  23.   }
  24.                   }
  25.             }
  26.       }
  27. }
  28.  
  29. MsgBox, Checking for Dir
  30. ifNotExist %A_WorkingDir%\..\..\Assets\samesfordfd\
  31.     FileCreateDir, %A_workingDir%\..\..\samesfordfd\
  32.     MsgBox, Made Dir, Moving File
  33. FileMove %FPath%, %A_WorkingDir%\..\..\samesfordfd\samesfordfd.pdf
  34. MsgBox,File Moved to %FPath%
  35.  
  36.   PdfExe  = %A_WorkingDir%\pdftk.exe
  37.    
  38.  filesList :="%A_WorkingDir%\..\..\samesfordfd\%FPath%"
  39.   Sort filesList
  40.   StringSplit files, filesList, `n
  41. PdfSplit( files1 )
  42. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement