Messages - schnarkle [ switch to compact view ]

Pages: [1] 2 3next
1
Hi all I found a solution to this from the autohotkey forums.  Code posted here for posterity...

gui, add, DateTime, vmydate altsubmit
Gui, add, Button, gGo ym, Go
Gui, Show
return
 
Go:
Gui, Submit
; removed useless stuff here
SetWorkingDir, %A_Desktop%\comics
 
BlockInput On ;disables keyboard or mouse use when script is running
 
; SALLY FORTH
MyURLpass :="user:pass"
; removed useless stuff here
MyURL := "http://bbs.rbma.com/repo/Sally_Forth/"  ; we'll add year and month in the loop
; removed useless line here
 
loop, 7 { ; switched to loop, while is unnecessary and wouldn't work anyway without changing value of n
FormatTime, mydate, %mydate%, yyyyMMdd ; fixes formatting from EnvAdd, which adds a timestamp
MyFile= SFT%mydate%.tif
FormatTime, year, %mydate%, yyyy
FormatTime, month, %mydate%, MM
RunWait % "curl.exe -o " MyFile " -u " MyURLpass " " MyURL year "/" month "/" MyFile ; -v more talkitive
EnvAdd, mydate, 1, Days      ; increases day by one
}

2
Hello,

I'm trying to script a download routine to get 7 days worth of comics at a time.  This is using Autohotkey.

The folder structure is like this  www.whatever.com/comics/2016/04
and filename like this "sf20160401.tif"

Here is what I have so far, and it works but when changing days it's not changing the folder structure to match..

gui, add, DateTime, vmydate altsubmit
Gui, add, Button, gGo ym, Go
Gui, Show
return

Go:
Gui, Submit
Year := SubStr(mydate,1,4)
Month := SubStr(mydate,5,2)
Day := SubStr(mydate,7,2)
SetWorkingDir, %A_Desktop%\comics

BlockInput On ;disables keyboard or mouse use when script is running

; SALLY FORTH
MyURLpass :="user:pwd"
MyURLYear := Substr(mydate,1,4)
MyURLMonth := Substr(mydate,5,2)
MyURLDay := Substr(mydate,7,2)
MyURL := "http://bbs.rbma.com/repo/Sally_Forth/" A_YYYY "/" A_MM "/"
Year := SubStr(mydate,1,4) ; had to change year for Beck arrangement

while n<7{
MyFile= SFT%date%.tif
RunWait % "curl.exe -o " MyFile " -u " MyURLpass " " MyURL "" MyFile ; -v more talkitive
EnvAdd Date, 1, Days      ;increases day by one
FormatTime, date, %date%, yyyyMMdd ;fixes formatting from EnvAdd, which adds a timestamp
}

Can anyone give it a go?  Even if you have to trash the cludge that I have ;)  ?

thanks!

3
Good grief you guys make it look so easy!

Thank you so much that was driving me nuts!

 :Thmbsup:

4
Finished Programs / DONE: Using AHK and PDFTK to combine daily pdf's
« on: November 14, 2012, 05:40 PM »
Hello,

I need to come up with a way of combining daily extracted pdfs in the proper order but am having problems with the number of different publications.

Our naming convention is :

pub  date     section
--------------------  
MM_111412_A01.pdf
MM_111412_A02.pdf
MM_111412_B01.pdf
MC_111412_A01.pdf
WR_111412_A01.pdf

I can do this for one pub easily i.e.

Code: Autohotkey [Select]
  1. SetWorkingDir, %A_ScriptDir%
  2. pub = MM
  3.  
  4. dest = D:\DATA\archives\hot\
  5. formattime, date, MMddyy, MMddyy
  6.  
  7. filename1 = %pub%_%date%_*.pdf
  8.  
  9. ifexist %filename1%
  10. Runwait %comspec% /c pdftk %filename1% cat output %dest%EA_%date%.pdf

But with 7 different pubs, some of which may or may not appear on a daily basis, I am stuck.

Here's what I came up with but it is not getting every pub and some pages are repeating.  I am trying but am an amateur N00B :)
Also, the pub order is as seen top to bottom.

Code: Autohotkey [Select]
  1. SetWorkingDir, %A_ScriptDir%
  2. pub = MM
  3. pub2 = MC
  4. pub3 = FE
  5. pub4 = CS
  6. pub5 = RE
  7. pub6 = VL
  8. pub7 = WR
  9.  
  10. dest = D:\DATA\archives\hot\
  11. formattime, date, MMddyy, MMddyy
  12.  
  13. filename1 = %pub%_%date%_*.pdf
  14. filename2 = %pub2%_%date%_*.pdf
  15. filename3 = %pub3%_%date%_*.pdf
  16. filename4 = %pub4%_%date%_*.pdf
  17. filename5 = %pub5%_%date%_*.pdf
  18. filename6 = %pub6%_%date%_*.pdf
  19. filename7 = %pub7%_%date%_*.pdf
  20.  
  21. FileList =
  22. Loop, *_%date%_*.pdf
  23. {
  24.  FileList = %FileList%%A_LoopFileName%`n
  25.  
  26.  Runwait %comspec% /c pdftk %filename1% %A_LoopFileName% cat output MTR_%date%.pdf
  27. }
Can anyone help?


5
Unfinished Requests / Re: Upload files listed in text file
« on: August 23, 2010, 08:59 AM »
Yes, it's basically an xml file that changes daily.  It identifies jpgs to look for, and I'd like to upload only the files listed in that xml file.  So yes the images listed would change daily.

Pages: [1] 2 3next
Go to full version