Highlighted

Can i change the same image in multiple artboards at once?

Contributor ,
May 19, 2020

Copy link to clipboard

Copied

Hi guys,

I am doing some social media post with many artboards an the image of a maganzine cover repets more than 20 times. I have to change it one by one or there is a way i could update it all at once? 

 

I guess i could always go to the original folder were the last number of the magazine cover is stored and replace it by the name of the new cover so when the files open it will ask me for the route. But by doing that i would be erasing the old cover jpg and it also be stored in and previous folder which is confussing which i do not want to do for order issues. 

 

Is there any other way?

 

Thanks for your help.

Hi again, I have written something that should work for you. Could you please try it? To use, make a selection of one of your placed images (the cover) and run the script. It will ask for you to select the new cover image file and (hopefully!) update each other old cover in the document.

 

 

var items = app.activeDocument.selection;
if (items.length > 0) {
    relinkPlacedItem(items[0]);
}

function relinkPlacedItem(placedItem, allInstances) {
    try {
        if (allInstances === undefined) allInstances = true;
        if (placedItem === undefined) throw 'No placedItem supplied to relinkPlacedItem.';
        if (placedItem.typename === 'GroupItem') {
            placedItem = placedItem.placedItems;
            if (placedItem.length === 0) throw 'No placedItem supplied to relinkPlacedItem.';
            placedItem = placedItem[0];
        }
        if (placedItem.file === undefined) throw 'No file linked to item.';
        // ask user for a new file
        var newFile = File.openDialog('Relink to:');
        if (newFile !== null) {
            var placedItems = app.activeDocument.placedItems;
            if (allInstances) {
                var matchedPlacedItems = [];
                for (var i = 0; i < placedItems.length; i++) {
                    if (placedItems[i].file.toString() === placedItem.file.toString()) {
                        // found an instance of the placedItem
                        matchedPlacedItems.push(placedItems[i]);
                    }
                }
                // relink the placedItems
                for (var i = 0; i < matchedPlacedItems.length; i++) {
                    matchedPlacedItems[i].relink(newFile);
                }
            } else {
                // relink just the selected placedItem
                placedItem.relink(newFile);
            }
        }
    } catch (error) { alert(error) }
}

 

 

Regards,

Mark

TOPICS
How to, Scripting

Views

1.1K

Likes

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

Can i change the same image in multiple artboards at once?

Contributor ,
May 19, 2020

Copy link to clipboard

Copied

Hi guys,

I am doing some social media post with many artboards an the image of a maganzine cover repets more than 20 times. I have to change it one by one or there is a way i could update it all at once? 

 

I guess i could always go to the original folder were the last number of the magazine cover is stored and replace it by the name of the new cover so when the files open it will ask me for the route. But by doing that i would be erasing the old cover jpg and it also be stored in and previous folder which is confussing which i do not want to do for order issues. 

 

Is there any other way?

 

Thanks for your help.

Hi again, I have written something that should work for you. Could you please try it? To use, make a selection of one of your placed images (the cover) and run the script. It will ask for you to select the new cover image file and (hopefully!) update each other old cover in the document.

 

 

var items = app.activeDocument.selection;
if (items.length > 0) {
    relinkPlacedItem(items[0]);
}

function relinkPlacedItem(placedItem, allInstances) {
    try {
        if (allInstances === undefined) allInstances = true;
        if (placedItem === undefined) throw 'No placedItem supplied to relinkPlacedItem.';
        if (placedItem.typename === 'GroupItem') {
            placedItem = placedItem.placedItems;
            if (placedItem.length === 0) throw 'No placedItem supplied to relinkPlacedItem.';
            placedItem = placedItem[0];
        }
        if (placedItem.file === undefined) throw 'No file linked to item.';
        // ask user for a new file
        var newFile = File.openDialog('Relink to:');
        if (newFile !== null) {
            var placedItems = app.activeDocument.placedItems;
            if (allInstances) {
                var matchedPlacedItems = [];
                for (var i = 0; i < placedItems.length; i++) {
                    if (placedItems[i].file.toString() === placedItem.file.toString()) {
                        // found an instance of the placedItem
                        matchedPlacedItems.push(placedItems[i]);
                    }
                }
                // relink the placedItems
                for (var i = 0; i < matchedPlacedItems.length; i++) {
                    matchedPlacedItems[i].relink(newFile);
                }
            } else {
                // relink just the selected placedItem
                placedItem.relink(newFile);
            }
        }
    } catch (error) { alert(error) }
}

 

 

Regards,

Mark

TOPICS
How to, Scripting

Views

1.1K

Likes

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
May 19, 2020 0
Adobe Community Professional ,
May 19, 2020

Copy link to clipboard

Copied

Yes, Not clear exactly what you are trying to do. I think it is a linked file but here are some options:

 

Global Edit

A gobal edit, if the artboards reside in the same file, can globally change similar objects at once. This is for a specific object

Screen Shot 2020-05-19 at 6.51.11 PM.png

 

Symbol

If you are using the same content in a document and it is made up of many objects then we are talking about a symbol. Just create a symbol out of the graphic. Then when you update the symbol all uses with be updated too.

Screen Shot 2020-05-19 at 6.58.08 PM.png

 

 

Place it in with a Link

If you have an image (jpeg, ai, etc)  in Illustrator and it is in multiple files and you want to replace it all at once, then you place it in using a Link. When you update the original file all uses of the link will be updated too.

Screen Shot 2020-05-19 at 6.57.57 PM.png

 

Likes

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
Reply
Loading...
May 19, 2020 1
Contributor ,
May 19, 2020

Copy link to clipboard

Copied

Hi Katie,
Thanks for the good reply. Sorry i might have not explain very well, English is not my native language.

 

I am trying to replace a linked file, a photo, which repeats 20 times in different artboards of one same file or document. I could go one by one but it is time consumming. Maybe there was an easy way. I tried Global Edit by it is greyed out, maybe a linked image cannot be a special object? I also tried to make the photo as Symbol but it will not admited a linked file. 

 

Regarding place it with a link the original AI file is a copy of a previous doc so it is taking the older route of the link. Maybe is way more easy and i don't see it, sorry. 

 

Thanks 😉

 

1.jpg

Likes

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
Reply
Loading...
May 19, 2020 0
Enthusiast ,
May 19, 2020

Copy link to clipboard

Copied

Bonjour,

Peut-être ? (si j'ai bien compris)

Tout sélectionner dans la liste

renél80416020_0-1589956911681.png

 

 

Likes

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
Reply
Loading...
May 19, 2020 1
Adobe Community Professional ,
May 19, 2020

Copy link to clipboard

Copied

Use Symbols and replace a symbol instance with a different symbol?

https://helpx.adobe.com/illustrator/using/symbols.html

 

Likes

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
Reply
Loading...
May 19, 2020 1
Contributor ,
May 20, 2020

Copy link to clipboard

Copied

Hi again, I have written something that should work for you. Could you please try it? To use, make a selection of one of your placed images (the cover) and run the script. It will ask for you to select the new cover image file and (hopefully!) update each other old cover in the document.

 

 

var items = app.activeDocument.selection;
if (items.length > 0) {
    relinkPlacedItem(items[0]);
}

function relinkPlacedItem(placedItem, allInstances) {
    try {
        if (allInstances === undefined) allInstances = true;
        if (placedItem === undefined) throw 'No placedItem supplied to relinkPlacedItem.';
        if (placedItem.typename === 'GroupItem') {
            placedItem = placedItem.placedItems;
            if (placedItem.length === 0) throw 'No placedItem supplied to relinkPlacedItem.';
            placedItem = placedItem[0];
        }
        if (placedItem.file === undefined) throw 'No file linked to item.';
        // ask user for a new file
        var newFile = File.openDialog('Relink to:');
        if (newFile !== null) {
            var placedItems = app.activeDocument.placedItems;
            if (allInstances) {
                var matchedPlacedItems = [];
                for (var i = 0; i < placedItems.length; i++) {
                    if (placedItems[i].file.toString() === placedItem.file.toString()) {
                        // found an instance of the placedItem
                        matchedPlacedItems.push(placedItems[i]);
                    }
                }
                // relink the placedItems
                for (var i = 0; i < matchedPlacedItems.length; i++) {
                    matchedPlacedItems[i].relink(newFile);
                }
            } else {
                // relink just the selected placedItem
                placedItem.relink(newFile);
            }
        }
    } catch (error) { alert(error) }
}

 

 

Regards,

Mark

Likes

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
Reply
Loading...
May 20, 2020 2
Adobe Community Professional ,
May 20, 2020

Copy link to clipboard

Copied

Let's suppose you have already placed that original file -as linked-, 20 times.

It's already in a folder, and you do not want to change it.

Open that file in Photoshop and Save As with another name (there are other ways to do it too) .

This will create a copy of the original stored even in the same folder.

Then back to the original file in Photoshop. Change it and save that. (Do not worry you already have saved the original file before). 

Back to Illustrator you will get this:

ines5.png

click YES.

(Linked files get updted, embedded not)

 

Likes

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
Reply
Loading...
May 20, 2020 3
Contributor ,
May 20, 2020

Copy link to clipboard

Copied

Thanks Federico,

Indeed it is a good tip! replacing the file name in the original folder so it will ask for the new one and i can always re-link the file the new cover folder. 

 

Cheers,
S

Likes

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
Reply
Loading...
May 20, 2020 1
Contributor ,
May 20, 2020

Copy link to clipboard

Copied

Wow! Thanks for the great job on the script!

it does work like a charm just selecting all the images and will change at the click of a mouse. Very useful and time saving for the future.

 

ariperro-arigato-MBIXP.jpg

Likes

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
Reply
Loading...
May 20, 2020 1