Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save a Image (daily)
#1
Hi,

I'm trying to create a Macro that save a WebImage every single day, naming the file with the current date, like "Image-2013-01-08".


Image link: http://image.weather.com/images/maps/fo ... 00x405.jpg


Could you help me please?
#2
Function download_image_123
Code:
Copy      Help
;allow single instance
if(getopt(nthreads)>1) end "The thread is already running. You can end it in the 'Running items' pane."

str sf sd ;;variables

;download image data into variable sd
int downloaded
rep 60 ;;repeat max 10 minutes every 10 s until success
,IntGetFile "http://image.weather.com/images/maps/forecast/precfcst_600x405.jpg" sd
,err 10; continue ;;if error, retry after 10 s
,downloaded=1
,break
if(!downloaded) end "failed to download"

;format filename and save to file
sf.timeformat("$my qm$\Image-{yyyy-MM-dd}.jpg")
sd.setfile(sf)

run sf ;;open the image. Delete this line if don't need.
If you'll schedule it, let it be function, not macro.
#3
I dont why but It doesn't work.

I just copy your code, paste on QM and run this Macro. But nothing happens.
#4
How can i just make the QM write the date in somewhere?

I tried:

sf.timeformat("$my qm$\Image-{yyyy-MM-dd}.jpg")
key sf

But it doesn't work too
#5
Run this macro. It opens the folder where previous macro saves the file. Look for file Image-2014-01-08.jpg.
Macro Macro2202
Code:
Copy      Help
run "$my qm$"
Also I added something more in the macro.
#6
It Worked. Thanks Friend.

I'll open a new topic asking about how can i do the same macro to save a .PDF file.


Forum Jump:


Users browsing this thread: 1 Guest(s)