Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Change specific link path across documents.

$
0
0

I'm writing a simple script to change the path for a number of links across multiple documents. I'm getting a 'filePath is a read only property' error for line 7, even though I'm not trying to rewrite it directly. Any help would be greatly appreciated. Thanks!

 

var myDocument = app.activeDocument;
var oldPath = "G:\\Users\\My PC\\Desktop\\";
var newPath = "G:\\Users\\My PC\\Desktop\\New Folder\\";for (a=0; a < myDocument.links.length; a++) {    var currentLink = myDocument.links[a];    var linkName = currentLink.name;    if (currentLink.filePath = oldPath) {        var myNewFile = new File(newPath + linkName);        currentLink.relink(myNewFile);        };    }; 

Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>