• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Relink Already Renamed files

Explorer ,
Aug 20, 2012 Aug 20, 2012

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

TOPICS
Scripting

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 21, 2012 Aug 21, 2012

Copy link to clipboard

Copied

Where and how were these files re-named?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 24, 2012 Aug 24, 2012

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 24, 2012 Aug 24, 2012

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 24, 2012 Aug 24, 2012

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 24, 2012 Aug 24, 2012

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 );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 24, 2012 Aug 24, 2012

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 ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 24, 2012 Aug 24, 2012

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…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 24, 2012 Aug 24, 2012

Copy link to clipboard

Copied

Right Mark, there isn't duplicates..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 24, 2012 Aug 24, 2012

Copy link to clipboard

Copied

shit ,

just wrote those lines which compares two existing files and relinks if equal ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 24, 2012 Aug 24, 2012

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 12, 2012 Sep 12, 2012

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 12, 2012 Sep 12, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines