Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ButtonGrabSummary:
- For wb in ComObjCreate("Shell.Application").windows
- If InStr(wb.LocationName, name) && InStr(wb.FullName, "chrome.exe" )
- Break ; Break loop, just one way to keep this pointer in wb
- url=https://apps.dealer.com/analytics/as/samesfordfd/samesfordfd-admin/report/executive-summary/pdf?endDate=2017-09-30&startDate=2017-09-01
- loginurl=login.dealer.com
- wb.navigate(url)
- ReportFunction(Directory, Changes) {
- For Each, Change In Changes {
- Action := Change.Action
- Name := Change.Name
- If (Action = 1){
- MsgBox,File Downloaded
- Loop, C:\users\%A_UserName%\Downloads\*.pdf
- {
- If (A_LoopFileTimeCreated>Rec) ;If the time of file created is greater discard the other one in memory
- {
- FPath=%A_LoopFileFullPath%
- Rec=%A_LoopFileTimeCreated%
- MsgBox, Newest File %Fpath%
- }
- }
- }
- }
- }
- MsgBox, Checking for Dir
- ifNotExist %A_WorkingDir%\..\..\Assets\samesfordfd\
- FileCreateDir, %A_workingDir%\..\..\samesfordfd\
- MsgBox, Made Dir, Moving File
- FileMove %FPath%, %A_WorkingDir%\..\..\samesfordfd\samesfordfd.pdf
- MsgBox,File Moved to %FPath%
- PdfExe = %A_WorkingDir%\pdftk.exe
- filesList :="%A_WorkingDir%\..\..\samesfordfd\%FPath%"
- Sort filesList
- StringSplit files, filesList, `n
- PdfSplit( files1 )
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement