Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save a Image (daily)
#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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)