Copy link to clipboard
Copied
Hi
I am using link replacer script for linking the linked images but I need to display the all the missing links in one alert display.
#target illustrator
function linkReplacer() {
var orginalUIL = app.userInteractionLevel;
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
if (app.documents.length == 0) {
alert('Please have an "Illustrator" document open before running this script.');
return;
} else {
docRef = app.activeDocument;
}
var defaultFolder = new Folder (Folder(app.activeDocument.path + '/../040 Images/043 High Res'));
var psdFolder = defaultFolder;
if (psdFolder == null) return;
with (docRef) {
var placedFiles = new Array();
for (var i = 0; i < placedItems.length; i++) {
placedFiles.push(placedItems.file.name);
}
for (var j = 0; j < placedItems.length; j++) {
var rePlace = new File(psdFolder.fsName + '/' + placedFiles
); if (rePlace.exists) {
placedItems
.file = rePlace; } else {
alert('File "' + placedFiles
+ '" is missing?'); }
}
}
app.userInteractionLevel = orginalUIL;
}
linkReplacer();
declare an array (in the example below i'm calling it missingLinks) at the top of the script to hold the names of the files. then replace this line:
alert('File "' + placedFiles
+ '" is missing?' );
with this
missingLinks.push(placedFiles);
then do your alert at the bottom of the script, like so:
if(missingLinks.length)
{
alert("The following liinks are missing:\n" + missingLinks.join("\n"));
}
Copy link to clipboard
Copied
declare an array (in the example below i'm calling it missingLinks) at the top of the script to hold the names of the files. then replace this line:
alert('File "' + placedFiles
+ '" is missing?' );
with this
missingLinks.push(placedFiles);
then do your alert at the bottom of the script, like so:
if(missingLinks.length)
{
alert("The following liinks are missing:\n" + missingLinks.join("\n"));
}
Copy link to clipboard
Copied
Thanks it is working good and helpful..
Find more inspiration, events, and resources on the new Adobe Community
Explore Now