happyhatter
Registered Member
- Jan 26, 2009
- 61
- 3
Is there a program that will help me automatically download images? I have saved some HTML pages to my hard drive that have links to images that I would also like to download to my hard drive.
TAB T=1
SET !ERRORIGNORE YES
SET !VAR2 0
ADD !VAR2 {{!LOOP}}
'TAB CLOSEALLOTHERS
'URL GOTO=http://www.iopus.com/imacros/demo/v5/images/
URL GOTO=file:///C:\myTest{{!VAR2}}.htm
'You can *start* the loop at another value with SET !LOOP. The default start value is 1.
'Since the SET !LOOP command sets a START value, it works only at the first loop.
'SET !LOOP 2
'TAG POS={{!loop}} TYPE=IMG ATTR=SRC:http://*.jpg
'
'You can use the FOLDER=* part of the ONDOWNLOAD command to define another download directory
'And you can overwrite the automatic file name generation by replacing
'FILE=+_{{!NOW:yyyy******d_hhnnss}}
'with
'FILE=yourname.ext
'
'
ONDOWNLOAD FOLDER=* FILE=*
'
'Download the picture
TAG POS=1 TYPE=IMG ATTR=SRC:http://*.jpg CONTENT=EVENT:SAVEITEM
'TAG POS=2 TYPE=IMG ATTR=SRC:http://*.jpg CONTENT=EVENT:SAVEITEM
'
'You can also use the EVENT:SAVEPICTUREAS command instead
'TAG POS=1 TYPE=IMG ATTR=HREF:http://*.jpg CONTENT=EVENT:SAVEPICTUREAS
'
'Or you can take a snapshot of the complete web page
'SAVEAS TYPE=BMP FOLDER=* FILE=MySnapshot_{{!NOW:yyyy******d_hhnnss}}.bmp
'
'Give the user time to press PAUSE
'WAIT SECONDS=1
'
'Go back to start page
'Use !urlstart if you removed the URL GOTO= command at the top of the macro
'URL GOTO={{!urlstart}}