Posts: 6
Threads: 1
Joined: Sep 2010
the project i have is to download appx. 6,000+ images and not enough time in the day to do it. i am somewhat knowledgeable in programming.(but still a little rusty)
here is what basically needs to be done:
1. start on image page on website. ex. deviantart.com (or something like it) ex. pic [
http://apc6254.deviantart.com/art/girati...-161381031]
2. enlarge pic after loading is complete
3. right click on pic and save to folder
4. remove pic from list (via button link)
5. loop to begining
the only thing is when recording the url of page will change, i just probably need a to scan for image, but am new to this type of coding, any help would be appreciated
Posts: 12,141
Threads: 143
Joined: Dec 2002
Do you already have part of the macro?
Posts: 6
Threads: 1
Joined: Sep 2010
int w1=act(win("(title of page would go here) - Mozilla Firefox" "MozillaUIWindowClass"))
lef 464 487
rig 464 487
mou "@A@AAAAAA@@AAAAAAAAAAA@ABAAAAA@ACA@ABB@ABAAAAABAABBA@ABAAAAABA@AAAAABAAAA@@AAAA@BB@AB@@AA@@AA@AA@AA@AAA@@AAAAA@AA@@AA@@AA@@A@AA@AAABAAAA@AA@@AA@AA@AAAAAAA@AA@@AA@@AA@A@@A@AA@@AA@@AA@AA@AAAA@@AA@@AA@@AAAA@@AA@"
lef 545 569
mou "@aa@@aa@@aaa@aa@aaaaaaaba@aaa@aaaababba@aaaaa@baaa@aa@aaa@a@@a@aa@a@@aa@@aa@@aaaa@@aaa@aa@@aaaa@@aa@aa@aaaa@aaaa@aa@aaaaa@@aa@@aa@@aaa@a@aa@@a@aaa@aa@@a@a@a@a@aa@@aa@@aa@@a@a@a@a@aaa@aaa@a@aa@@a@a@a@aa@@a@a@a@a@aa@@a@a@a@a@aa@@a@aa@@a@a@a@a@aa@@a@a@aa@@a@a@a@aa@@a@a@aa@@a@a@a"
5 win("Save Image" "#32770")
lef 477 466
act w1
lef 477 466
mou "a@a@a@a@a@a@baa@aac@b@babab@dab@c@dacac@dadaeae@c@daeagadacafad@gafafadagagafaf@gafahciae@ibgaiaiahbgajakbhajbgbjakbhbiaiajajbjahbjbhbjahaibhahahbiajagagahaia@a@a@a@a@a@c@a@a@a@a@a@a@a@a@a@a@a@a@aA@@AA@A@A@A@A@A@A@A@A@A@A@A@A@@aA@@aA@@aA@@aAa@aAaAa@aBa@aAbA@@bAaAa@aAaAcA@Ab@a@aAbA@@b@aA@@a@aAaAa@a@a@a@aA@@a@a"
lef 36 329
there is only two thing that would change the title of the page and the image (b/c different location, different image) and this code is straight recording(except for the change i made to the first line)
Posts: 1,000
Threads: 253
Joined: Feb 2008
I think this is a job for an automated browser control and IntGetFile.
Posts: 6
Threads: 1
Joined: Sep 2010
TheVig Wrote:I think this is a job for an automated browser control and IntGetFile.
could you go into a little more detail
Posts: 12,141
Threads: 143
Joined: Dec 2002
How do you choose images that you want to download?
In your macro, lef 464 487 gets image from recorded location in browser window. But I don't think it is what you need, because the location will be different for each image.
Do you:
a. Want to download image from mouse?
b. Want to download all images in the page?
c. ...?
Posts: 12,141
Threads: 143
Joined: Dec 2002
Function
Macro1471
Trigger
F12
;This function downloads image from mouse from deviantart.com.
;Recommended trigger: F12 or other keyboard trigger.
;How to use:
;;;Change saveToFolder (see below) to the real path of the folder where to save the images.
;;;Open "http://browse.deviantart.com" in Internet Explorer (not Firefox). It must show many small images.
;;;Move mouse to an image. Run this function (press the trigger key). Do it for each image that you need. Don't need to wait until the function ends.
;;;This function downloads large version of the image, and runs it.
str saveToFolder="$desktop$\deviantart" ;;change this
;_________________________
Acc aImg=acc(mouse) ;;<IMG>
aImg.Navigate("parent") ;;<A> that contains the <IMG>
Htm elImg=htm(aImg)
str s=elImg.HTML
;out s
;most thumbnails have direct url to the large image. Extract it.
str url
if(findrx(s "super_img=''(.+?)''" 0 1 url 1)<0)
,;this thumbnail does not have the url. Need to download page and get the url from there.
,if(findrx(s "href=''(.+?)''" 0 1 url 1)<0) end "failed"
,IntGetFile url s
,;out s
,if(findrx(s "<IMG\s[^>]+\sid=''gmi-ResViewSizer_img''[^>]+\ssrc=''(.+?)''" 0 1 url 1)<0) end "failed"
;out url
s.getfilename(url 1)
str sFile.from(saveToFolder "\" s)
mkdir saveToFolder
IntGetFile url sFile 16
;_________________________
;see what we have
run sFile ;;delete this line if you don't want to see the downloaded image
Posts: 6
Threads: 1
Joined: Sep 2010
Gintaras Wrote:How do you choose images that you want to download?
In your macro, lef 464 487 gets image from recorded location in browser window. But I don't think it is what you need, because the location will be different for each image.
Do you:
a. Want to download image from mouse?
b. Want to download all images in the page?
c. ...?
its enlarging image from mouse, and then right click save as
Posts: 6
Threads: 1
Joined: Sep 2010
Gintaras Wrote:Function Macro1471
Trigger F12 
;This function downloads image from mouse from deviantart.com.
;Recommended trigger: F12 or other keyboard trigger.
;How to use:
;;;Change saveToFolder (see below) to the real path of the folder where to save the images.
;;;Open "http://browse.deviantart.com" in Internet Explorer (not Firefox). It must show many small images.
;;;Move mouse to an image. Run this function (press the trigger key). Do it for each image that you need. Don't need to wait until the function ends.
;;;This function downloads large version of the image, and runs it.
str saveToFolder="$desktop$\deviantart" ;;change this
;_________________________
Acc aImg=acc(mouse) ;;<IMG>
aImg.Navigate("parent") ;;<A> that contains the <IMG>
Htm elImg=htm(aImg)
str s=elImg.HTML
;out s
;most thumbnails have direct url to the large image. Extract it.
str url
if(findrx(s "super_img=''(.+?)''" 0 1 url 1)<0)
,;this thumbnail does not have the url. Need to download page and get the url from there.
,if(findrx(s "href=''(.+?)''" 0 1 url 1)<0) end "failed"
,IntGetFile url s
,;out s
,if(findrx(s "<IMG\s[^>]+\sid=''gmi-ResViewSizer_img''[^>]+\ssrc=''(.+?)''" 0 1 url 1)<0) end "failed"
;out url
s.getfilename(url 1)
str sFile.from(saveToFolder "\" s)
mkdir saveToFolder
IntGetFile url sFile 16
;_________________________
;see what we have
run sFile ;;delete this line if you don't want to see the downloaded image
thanks a bunch it works pretty well, have a few errors from certain pic but they work out. and btw is this code in java?
Posts: 12,141
Threads: 143
Joined: Dec 2002
Quote:is this code in java
QM does not use java.
Posts: 6
Threads: 1
Joined: Sep 2010
Gintaras Wrote:Quote:is this code in java
QM does not use java.
then it is its own programming language then? (the reason i said java is because i notice the if statement)
Posts: 12,141
Threads: 143
Joined: Dec 2002
Yes. Some parts of it are similar to other languages, like C++ and VB.