Script to replace a link based on filename
I've got a some images that have had numbers added to the ends of the filenames. I'd like to relink them back to the original, un-numbered file.
So,
myImage-1.jpg relinks to myImage.jpg
myImage-2.jpg relinks to myImage.jpg …
I wrote a script to run through all the links in the document, then use grep to see if an un-numbered version of that file exists for relinking, but I have to wonder: is there some quicker/better way to target individual links without running through the entire list of links to find them?
I thought to try
app.activeDocument.links.item(/myImage-\d+.jpg/)but that doesn't work.
Thanks for any advice!
