Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Automator Help Please

Automator Help Please
Thread Tools
Grizzled Veteran
Join Date: May 2001
Location: Ca
Status: Offline
Reply With Quote
May 4, 2005, 04:16 AM
 
Hello does anyone know how to Download the images from a website. Say a thread on Macnn that has images that are linked to the thread(Images that are hosted on another site, not the inline images) Right now I can only get automator to Download the gifs and what not that make up the fourm; the smilies, and other interface images that are all 4 KB from the current page in safari. I want the full res images from the link that you guys so offen provide. The are 2 options in automator using the Get Image URL's From Webpage action:
1. On these webpages
2. Linked from these webpages


Any thoughts on how this is done.

real
With some loud music + a friend to chat nearby you can get alot done. - but jezz, I'd avoid it if I had the choice---- If only real people came with Alpha Channels.......:)
AIM:xflaer
deinterlaced.com
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
May 4, 2005, 07:34 AM
 
The built-in automator action (from your description) sounds too blunt for what you need.

Try using a lower level of scripting.

I'd suggest using a mix of applescript and javascript (to extract the appropriate img elements from the source).

[php]
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"
-- try
set thisImageSRC to do JavaScript the JSCode in frontDoc
-- end try
if thisImageSRC does not contain domainRoot then
log ("external image - " & thisImageSRC)
copy thisImageSRC to end of imageURLsList
end if

end repeat
return imageURLsList
end tell
[/php]

n.b. - this will extract URLs of *any* external image from the page - so Sigs, ads etc. may well be included.
(Last edited by Diggory Laycock; May 4, 2005 at 07:58 AM. (Reason:Formatting))
     
Mac Elite
Join Date: Sep 2001
Location: Some dust-bowl of a planet
Status: Offline
Reply With Quote
May 4, 2005, 09:31 AM
 
Originally Posted by real
Hello does anyone know how to Download the images from a website. Say a thread on Macnn that has images that are linked to the thread(Images that are hosted on another site, not the inline images) Right now I can only get automator to Download the gifs and what not that make up the fourm; the smilies, and other interface images that are all 4 KB from the current page in safari. I want the full res images from the link that you guys so offen provide. The are 2 options in automator using the Get Image URL's From Webpage action:
1. On these webpages
2. Linked from these webpages


Any thoughts on how this is done.

real
Image siphoning with Automator is a mixed bag right now; sometimes it works great, other not. It tends to have problems with script-driven sites, such as blogs and message boards.

You can embed an Applescript like the one above into a workflow; perhaps try this one as a starting point:
http://www.automatorworld.com/2005/0...rive/#comments
Note in the comments it needs editing, but basically hard-coded folder pointing in workflows is problematic when sharing them.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
May 4, 2005, 10:31 AM
 
Hmm - I thought I'd better experiment with Automator:

http://www.diggory.net/grazing/tiger...torScraper.zip

Is the script as an Automator action.
     
real  (op)
Grizzled Veteran
Join Date: May 2001
Location: Ca
Status: Offline
Reply With Quote
May 4, 2005, 02:11 PM
 
Thanks for the help

How do I go about embeding the Apple script in the workflow?


Thanks again for the time

real
With some loud music + a friend to chat nearby you can get alot done. - but jezz, I'd avoid it if I had the choice---- If only real people came with Alpha Channels.......:)
AIM:xflaer
deinterlaced.com
     
real  (op)
Grizzled Veteran
Join Date: May 2001
Location: Ca
Status: Offline
Reply With Quote
May 4, 2005, 02:17 PM
 
Never mind I should look before posting. I see the "Run Applescript Action"


Diggory Laycock thanks for the Workflow Link.


real
With some loud music + a friend to chat nearby you can get alot done. - but jezz, I'd avoid it if I had the choice---- If only real people came with Alpha Channels.......:)
AIM:xflaer
deinterlaced.com
     
real  (op)
Grizzled Veteran
Join Date: May 2001
Location: Ca
Status: Offline
Reply With Quote
May 4, 2005, 05:52 PM
 
Thanks again Guys,

Still working on something i find usefull. Sometimes it works sometimes it doesn't.
With some loud music + a friend to chat nearby you can get alot done. - but jezz, I'd avoid it if I had the choice---- If only real people came with Alpha Channels.......:)
AIM:xflaer
deinterlaced.com
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2