Copying link location

Hi,
I don’t think this can be done. My company uses iStock for pictures and illustrations, but we don’t distribute enough copies of our publications to warrant having to identify the artist/photographer, until now. Unfortunately, I just discovered that iStock does not provide the name of the artist when you download the picture or in any of its reports. And you cannot get their names from the site itself, because they are only identified by their handle. (!@$#)

So I wrote a script that can find the author’s name from the source page (it’s in the metadata). Problem is I can only make it work one at a time.

What I’d like to do is be able to right click on each pic that is in a light box, and have that link location be copied into a list. Then I could have Safari open each link location and run my script, and write the results to an Excel file.
But how do you script a web page (or can you?) I’m perfectly happy opening iStock manually, going to the light box, but from there I’d like to have Applescript automate the rest.

Any ideas?

Helping you would be very much easier if we saw your script(s). I would imagine this process as starting with a repeat loop that let you choose the pix and made a list of your choices and when done dropped you out of that loop and iterated through that list to capture the data from the source.

Adam,

Here’s what I have.


global mySource

tell application "Safari"
	tell document 1
		set mySource to source as text
	end tell
end tell
--these lines of generated source always contain the artist name and the stock number
set p6 to paragraph 6 of mySource
set p20 to paragraph 20 of mySource
--get the artist's name
repeat with a from 1 to ((count of words of p6))
	if word a of p6 = "copyright" then
		set CreatorFirstName to word (a + 1) of p6 as text
		set CreatorLastName to word (a + 2) of p6 as text
		set theCreator to CreatorFirstName & " " & CreatorLastName
	end if
end repeat
--get stock number for reference
if p20 contains "illustration" then
	set iStockNumber to (characters 60 thru -5) of p20 as string
else
	set iStockNumber to (characters 54 thru -5) of p20 as string
end if

set theStuff to theCreator & ":" & iStockNumber
return theStuff
end
end

Now that’s just the heart of what I want to do. I’d like to show a screen shot of the page I’m starting with (can’t give the link as that requires a password). It has all the pics, with their links. If I can get all the links into a list, I can iterate through the list and run the above script in a handler for each link. That necessitates someone sitting at the computer, right clicking each link, and selecting “Copy Link Location”. I don’t know how a user interaction like that could actually work.

Thanks again for any suggestions.