Check out this thread – post #62. With a little modification this script will do what you want.
Thanks - how do i find "Post #62" ? sorry - maybe dumb queston but i couldn't see any number references to the posts.
Thanks, i read though the entire thread and picked up some great stuff, however what i'm trying to do is this...
I have an InDesign document that references a link to a file:
james smith before.tif
I want to relink this to a new file named:
So you see, i have to ammend the file name to replace [space] with [-], and then [.tif] with [.jpg]
Is there something out there that does this already or is something somebody on here could help me with?
var myOldName = "james smith before.tif";
// replace extention
var myNewName = myOldName.replace(/\.tif$/i, "") + ".jpg";
// replace spaces with dashes
myNewName = myNewName.replace(/ /g, "-")
Sweet! I haven't tested it yet but i think this is just what i need.
I will add some code for generating an array of the names in my file, then pass this through to the myOldNames variable. It should work like a charm.. i will post back with my results.