Copy link to clipboard
Copied
Hey pixxxel schubser It works for link image.
But i have many files with embedded image under clipping mask. Could you help make a change the script for it? Thanks
[ Branched by moderator from previous discussion ] --> relink all selected
here you go, you still need to select the clipped images (the images themselves, not the mask). You can do that with the group selection tool
//#target Illustrator
// script.name = relinkAllSelected.jsx;
// script.description = relinks all selected placed images at once;
// script.required = select at least one linked image before running;
// script.parent = CarlosCanto // 7/12/11; 05/12/19 updated for CC2019
// script.elegant = false;
var idoc = app.activeDocument;
sel = idoc.selection;
i
...
Copy link to clipboard
Copied
This is what I would need as well
Copy link to clipboard
Copied
here you go, you still need to select the clipped images (the images themselves, not the mask). You can do that with the group selection tool
//#target Illustrator
// script.name = relinkAllSelected.jsx;
// script.description = relinks all selected placed images at once;
// script.required = select at least one linked image before running;
// script.parent = CarlosCanto // 7/12/11; 05/12/19 updated for CC2019
// script.elegant = false;
var idoc = app.activeDocument;
sel = idoc.selection;
if (sel.length>0) {
var file = File.openDialog ("open file");
file = new File(file.fsName.replace("file://","")); // Mac OS Lion fix by John Hawkinson
for (i=0 ; i<sel.length ; i++ ) {
if (sel[i].typename == "PlacedItem") {
var iplaced = sel[i];
iplaced.file = file;
}
if (sel[i].typename == "RasterItem") {
var iplaced = idoc.placedItems.add();
iplaced.file = file;
iplaced.move(sel[i], ElementPlacement.PLACEBEFORE);
h = sel[i].height;
w = sel[i].width;
x2 = sel[i].left;
y2 = sel[i].top;
iplaced.position = [x2+w/2-iplaced.width/2, y2-h/2+iplaced.height/2];
sel[i].remove();
}
}
}
else
{
alert("select at least one placed item before running");
}
Copy link to clipboard
Copied
It's works. Thank you so much!
Copy link to clipboard
Copied
hello. failed to execute.
(Adobe Illustrator 2023/Mac OS Monterrey)
 Thanks.
Copy link to clipboard
Copied
Save as plain Text in your text editor (not in Word for example) then rename as *.jsx