Replacing a linked object with a similar one in Illustrator 10

Just wondering if there was any way to replace a linked object (a TIFF file) with another similar linked object (TIFF) in illustrator 10. I have an applescript that will open an illustrator file and do a save as action to save it under a different name in another folder.
Before it saves, applescript needs to identify the linked object (example: animalpicture1.tif) and replace it with another tif file (example: animalpicture2.tif).

Any help would be greatly appreciated.

try this to get you started


tell application "Adobe Illustrator 10"
	set newImage to index of every raster item of document 1 whose file path contains "old filename"
	set file path of raster item newImage of document 1 to file "new:file:PATH:here"
end tell

HTH -john

That looks like exactly what I need! Thanks a million!