Posts: 99
Threads: 44
Joined: Jan 2014
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?
Posts: 12,051
Threads: 140
Joined: Dec 2002
Function
download_image_123
;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.
Posts: 99
Threads: 44
Joined: Jan 2014
I dont why but It doesn't work.
I just copy your code, paste on QM and run this Macro. But nothing happens.
Posts: 99
Threads: 44
Joined: Jan 2014
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
Posts: 12,051
Threads: 140
Joined: Dec 2002
Run this macro. It opens the folder where previous macro saves the file. Look for file Image-2014-01-08.jpg.
Macro
Macro2202
Also I added something more in the macro.
Posts: 99
Threads: 44
Joined: Jan 2014
It Worked. Thanks Friend.
I'll open a new topic asking about how can i do the same macro to save a .PDF file.