Copy link to clipboard
Copied
Yep, I'm sure this has been asked before, but is there a script out there which enables batch relinking files which contain the same data but have been renamed? (Win7, ID CS5)
Thanks in advance,
Andy
Copy link to clipboard
Copied
Where and how were these files re-named?
Copy link to clipboard
Copied
So sorry for the delayed reply Mark,
The files are in the same directory as before, and renamed in no particular pattern. So, I can't use some of the other renaming/relinking scripts I've found so far because they require a renaming pattern to be used, such as add a particular string, number, etc. What I'm looking for is a relinking script that would relink based on the file's data and ignore the new filename. Is something like this possible?
Copy link to clipboard
Copied
Possible maybe… depends mostly upon your linked files… ID will store info about your links in it's XMP… each link should have instance ID and document ID you could use the external XMP library and match these up… Well that would be the principle… In practice Im rubbish at XMP
Copy link to clipboard
Copied
Ah ha, well I'm mostly rubbish at scripting. With my design work, I simply don't have the time to learn it, so I'm sure you're ahead of me.. Ok well hopefully someone will post with some more knowledge of what you speak of.
Thanks!
Copy link to clipboard
Copied
It may also be possible to just do some comparison… This may be enough I don't know?
var doc = app.activeDocument;
$.writeln( doc.links.firstItem().linkXmp.creationDate );
$.writeln( doc.links.firstItem().linkXmp.modificationDate );
$.writeln( doc.links.firstItem().linkXmp.creator );
$.writeln( doc.links.firstItem().linkXmp.format );
Copy link to clipboard
Copied
Hi,
never tried this before and I'm on a mac for the next weeks, but what about the console?
Say you've got both files, the original and the renamed one.
In AppleScript you can implement Unix-Commands like 'diff' or 'cmp' which compare two files, so if identical ... relink
There should be a simular DOS-command too. It's called 'comp' I think. Implementation in JavaScript is not as good, but a tmp-bat-file at least can be written and executed ...
Copy link to clipboard
Copied
I don't think there are 2 files to compaire? Just one that has been renamed and in doing so is a broken link…
Copy link to clipboard
Copied
Right Mark, there isn't duplicates..
Copy link to clipboard
Copied
shit ,
just wrote those lines which compares two existing files and relinks if equal ...
Copy link to clipboard
Copied
Well I was thinking you could match up some date objects but with a quick test I can't get it to play ball… What I can't work out yet is…
A link odject linkXmp.creationDate == file object.created
they report different but I don't know why… hum?
Copy link to clipboard
Copied
Just wondering if anyone has came up with a solution for this script yet? I'm going through the laborious task of manually relinking already renamed files now.. blehh... Sure wish I had more time to learn more scripting... But thanks for you all's input thus far anyway
Copy link to clipboard
Copied
Hi,
what's your handling like¿ Do you choose them by visual control?
This can probably not be done by script ...
Write a list:
oldName <>newName then it'll be done easy.
Hans-Gerd Claßen