The Applescript "Display Thumb-linked images" from Apple's Safari scripting page doesn't work (even on their own example page!). Here's how to get it to work.
Open the script up with script editor. Find the following lnelines:
set the images_list to {}
repeat with i from 1 to number of items in image_links
set this_item to item i of image_links
if this_item does not contain "http:" then
set the target_URL to my parse_imagepath(this_item)
if the target_URL ends with ".jpg" then
set the end of the images_list to the target_URL
end if
end if
end repeatChange them to the following. I've put in comments to show what I did, and will explain why below.set the images_list to {}
repeat with i from 1 to number of items in image_links
set this_item to item i of image_links
--if this_item does not contain "http:" then
set the target_URL to my parse_imagepath(this_item)
-- the next line was just ".jpg"
if the target_URL ends with ".jpg" or target_URL ends with ".JPG" then
set the end of the images_list to the target_URL
end if
--end if
end repeatRead the rest of the hint for the explanations and one more subtle change...
Firstly, on the example site, all the images' links are not relative and therefore do contain the text "http:". This causes the list of image urls to be empty - hence the error message. The other change causes files ending in ".JPG" to be found too. exercise to the reader - I'm sure there are many other file type extensions that could be added here too.
OK, but one more problem to solve. The script expects the images to have relative URLs - and will therefore prefix the "parent url" onto the image urls - this is not what you want if they contain "http://blah/" - you get "http://blah/http://image". So when we loop round opening each window, we need to be a little careful. The line:
set the image_URL to (the parent_URL & this_item) as stringneeds to read if this_item does not contain "http:" then
set the image_URL to (the parent_URL & this_item) as string
else
set the image_URL to this_item as string
end ifSo we only append a parent or base URL when the image path is relative. Done!
[robg adds: These changes worked for me when I tested the revised script on the example page...]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030218121021156