Copy link to clipboard
Copied
Hello, everyone.
I am writing the script for relinking on illustrator file. It is perfectly working on illustrator CC2014. but I got the issue on illustrator CC2017 and illustrator CC2018.
Note: I am mentioned manual link location and Script linked locations differ on link palate location. snapshot for your reference.
kindly advice how to mention the folder location in the script.
Issue reference:
Folder structure reference:
Script reference:
#target illustrator-21
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
} else {
alert('File "' + placedFiles
}
}
}
app.userInteractionLevel = orginalUIL;
}
linkReplacer();
Copy link to clipboard
Copied
I am trying to follow your post...I am a little confused as to what you are asking. So it is putting in the wrong file location?
Copy link to clipboard
Copied
yes, palate mention location is wrong.
Copy link to clipboard
Copied
where is the activeDocument saved?
var defaultFolder = new Folder (Folder(app.activeDocument.path + '/../040 Images/043 High Res'));
Copy link to clipboard
Copied
Hi CarlosCanto,
Active Document saved location for your reference (smb://indae01/ExampleJobContainer/00_Kalai_Test/030 Assembly/activeDocument.ai).
Thanks in Advance.
Kalaimani Sathiyanathan
Copy link to clipboard
Copied
your script worked fine here under Windows 10, CC2019. It didn't add the unwanted folders.
do this folder actually exist? or is it just wrongly reported in the UI?
00_Kalai_Test/030 Assembly/00_Kalai_Test/040 Images/043 High Res
Copy link to clipboard
Copied
this script worked fine here under iMac (OS: macOS High Sierra, CC2017 to CC2019.
it is wrongly reported in the UI.
Copy link to clipboard
Copied
oh ok, then it is not impeding your work, still annoying but at least you can carry on.