Hi all,
I am working on a project to create photo albums on a website, and all my images are currently on kodakgallery.com. I am trying to use automator to get all the full-size images from the site, but since the images reside on a different server the GET LINKED IMAGES option doesn't work. I found this nifty little script that lets me downbload the thumbnails:
on run {input, parameters}
tell application "Safari"
set imageURLsList to {} as list
set frontDoc to the front document
-- the domain of the page - we only want external image links
set domainRoot to do JavaScript "document.domain" in frontDoc
-- the number of images in the front document
set numberOfImages to do JavaScript "document.images.length" in frontDoc
repeat with i from 0 to (numberOfImages - 1)
set the JSCode to "document.images[" & i & "].src"
set thisImageSRC to do JavaScript the JSCode in frontDoc
if thisImageSRC does not contain domainRoot then
log ("external image - " & thisImageSRC)
copy thisImageSRC to end of imageURLsList
end if
end repeat
end tell
return imageURLsList
end run
The problem is that I need the full size images, not the thumbs! Can anyone tell me how to modify the code to tell it to get the link to the page that opens when you click the thumbs, rather than the thumbs themselves? Does that make sense? Thanks!!!
Billy 🙂
I am working on a project to create photo albums on a website, and all my images are currently on kodakgallery.com. I am trying to use automator to get all the full-size images from the site, but since the images reside on a different server the GET LINKED IMAGES option doesn't work. I found this nifty little script that lets me downbload the thumbnails:
on run {input, parameters}
tell application "Safari"
set imageURLsList to {} as list
set frontDoc to the front document
-- the domain of the page - we only want external image links
set domainRoot to do JavaScript "document.domain" in frontDoc
-- the number of images in the front document
set numberOfImages to do JavaScript "document.images.length" in frontDoc
repeat with i from 0 to (numberOfImages - 1)
set the JSCode to "document.images[" & i & "].src"
set thisImageSRC to do JavaScript the JSCode in frontDoc
if thisImageSRC does not contain domainRoot then
log ("external image - " & thisImageSRC)
copy thisImageSRC to end of imageURLsList
end if
end repeat
end tell
return imageURLsList
end run
The problem is that I need the full size images, not the thumbs! Can anyone tell me how to modify the code to tell it to get the link to the page that opens when you click the thumbs, rather than the thumbs themselves? Does that make sense? Thanks!!!
Billy 🙂