• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
4

Release all anchored objects at once

Explorer ,
Dec 04, 2011 Dec 04, 2011

Copy link to clipboard

Copied

Dear All, I want to release an all anchored objects from my file. All anchors are created inside the table. I am using InDesign CS4.

I have a file for 4 pages which is containing more than 150 images to be released from anchored. That images should be placed in the same place. Only need to release. I want to do this for more than 100 files (400 pgs. it may increase in future). I tried this in Search/replace option using Object, but only i can able to find using custom option in the anchor options panel, not able to relase using search and replace.

Please help me ASAP.

Thanks in Advance, Thiru

TOPICS
Scripting

Views

26.8K

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
community guidelines

correct answers 1 Correct answer

Guide , Dec 05, 2011 Dec 05, 2011

Try this:

var a = app.activeDocument.allPageItems, t;

while( t = a.pop() )

    {

    t.isValid &&

    t.hasOwnProperty('anchoredObjectSettings') &&

    (t.parent instanceof Character) &&

    (t=t.anchoredObjectSettings).isValid &&

    t.releaseAnchoredObject();

    }

@+

Marc

Votes

Translate

Translate
Community Expert ,
Oct 26, 2017 Oct 26, 2017

Copy link to clipboard

Copied

Look at the dates of this thread. You are reviving a question thread that is nigh on 6 years old. (And with a relatively unrelated question as well.) Please observe proper netiquette and post new questions as new questions.

Also, if you tried to do so yourself: include what you tried, what didn't work, what error you got etc.

If you need a fully custom script written from scratch, and someone has the time to help you out for free, you're in luck. Else just hire someone.

Votes

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
community guidelines
New Here ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

Hi there,

I've read this thread, and it all makes sense, but I can't get it to work. Perhaps things have changed a lot since 2017. I've created a jsx file, which i execute from the script panel in inDesign. it contains the following:

var a = app.activeDocument.allPageItems, t;

while( t = a.pop() )
    {
    t.isValid &&
    t.hasOwnProperty('anchoredObjectSettings') &&
    (t.parent instanceof Character) &&
    (t=t.anchoredObjectSettings).isValid &&
    t.releaseAnchoredObject();
    }

However, all my objects are still anchored.

I'm on inDesign 19v. 

Any help would be appreciated. 

Votes

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
community guidelines
Community Expert ,
Nov 03, 2023 Nov 03, 2023

Copy link to clipboard

Copied

That's because Marc's script deals only with anchored objects, not with inlines. So inline frames should be converted to anchored frames, then released. For some reason that can't be added to Marc's script (I can't, anyway), it needs something different:

var a = app.activeDocument.allPageItems;
for (var i = a.length-1; i >= 0; i--) {
  if (a[i].parent instanceof Character) {
    try {
      a[i].anchoredObjectSettings.anchoredPosition = AnchorPosition.ANCHORED;
      a[i].anchoredObjectSettings.releaseAnchoredObject();
    } catch (_) {
    }
  }
}

 

Votes

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
community guidelines
Explorer ,
Jan 16, 2024 Jan 16, 2024

Copy link to clipboard

Copied

LATEST

Thank you so much Peter! Exactly what I was looking for, it would be even more if all released inline objects could have a wrap around the bounding box so that they don't move in the layout.

Votes

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
community guidelines
Community Expert ,
Aug 10, 2021 Aug 10, 2021

Copy link to clipboard

Copied

Look for ~a (in the Grep tab of the Find/Change window).

You can find it in the flyout menus of the Find/Change window

PeterKahrel_0-1628579628239.png

 

 

Votes

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
community guidelines
Contributor ,
Jun 24, 2018 Jun 24, 2018

Copy link to clipboard

Copied

I suffer from this problem please

How can I put this script in indesign

I opened notepad file and pasted this code in it and clicked save , closed the file

opened it and went to file , save as , changed its extension to jsx

Put it in C:\Program Files\Adobe\Adobe InDesign CC 2018\Scripts\Scripts Panel\Samples\JavaScript

restarted indesign biu the code don't run

Votes

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
community guidelines
Community Expert ,
Jun 25, 2018 Jun 25, 2018

Copy link to clipboard

Copied

Hi romeozzzzzzz ,

for using and installing ExtendScript scripts with InDesign see:

Indiscripts :: Indiscripts for Dummies

Just a note on the offered code here. Three things that can go wrong:

1. The anchored object is part of overset text. Released objects that are anchored in anchored objects could be removed.

2. The anchored object is anchored inline or anchored above line and method releaseAnchoredObject() will not work.

3. The anchored object released will not stay in position.*

* EDIT: When Inline and Above Line anchored object are duplicated and originals are removed as alternative to using method releaseAnchoredObject() that is only working with anchored anchored frames.

Regards,
Uwe

Votes

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
community guidelines
Explorer ,
Dec 05, 2011 Dec 05, 2011

Copy link to clipboard

Copied

Hi CSM,

Thanks for your effort in this, yah you are right its working good. But for some files it is not working.

I would like to share that file with you all to test file. Plz let me know how to share that with this forum? or plz give me any email id and i will send you that file.

Thanks

Votes

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
community guidelines
Community Beginner ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

HI csm

                 To add an Element and attribute as image in doc.Image is in Anchored text frame image also in Anchored ,I tried to add Indesign Quiet automatically.

Votes

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
community guidelines
Advocate ,
Dec 05, 2011 Dec 05, 2011

Copy link to clipboard

Copied

Hi Pathi,

Please try the below js code, Otherwise you can post your full code  i will check and clear your problem.

app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat= "^a";
app.activeDocument.changeText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

thx

csm_phil

Votes

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
community guidelines
Participant ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Wanted to add something to this old thread about the script to release all anchored objects.

If you double click it and nothing happens, it may be because the objects are considered un-releasable by InDesign. Like if you click one and go to the anchored objects menu, the release option is grayed out. This may be a bug or have to do with grouping.

You can fix it by clicking within the text box containing those objects, doing select all, and then going up to object - anchored object - Options. Then change the position dropdown to "Custom". At this point the objects may all collapse together since they no longer have their previous position settings... but they will now be allowed to release. At this point the script should work.

Votes

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
community guidelines
New Here ,
Aug 08, 2021 Aug 08, 2021

Copy link to clipboard

Copied

Thanks a lot!

 

Votes

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
community guidelines
Community Expert ,
Aug 09, 2021 Aug 09, 2021

Copy link to clipboard

Copied

Hi CreeDeaux,

as you said: One can only release "custom" anchored objects.

 

It's the same with scripting. A script has to change the kind of anchoring first, only then is the method for releasing the anchored object available. I think this is not a bug, just a missing feature.

 

Also note:

For a single instance you could also cut the anchored object and paste it in place.

Unfortunately that could fail so that the position on the page is not the original one when anchored.

A script can correct that as well and move the un-anchored object to the right position.

 

Regards,
Uwe Laubender

( ACP )

Votes

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
community guidelines
New Here ,
Jan 30, 2020 Jan 30, 2020

Copy link to clipboard

Copied

Here's my effort, building on Marc's work: https://gist.github.com/mhjb/5f78dee507754f0871891efe2c70d5ba

This script 'frees' & styles all anchored texts in a document, replacing anchors with the contained text

Votes

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
community guidelines
New Here ,
Sep 27, 2021 Sep 27, 2021

Copy link to clipboard

Copied

Ravi

Votes

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
community guidelines
Participant ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

There really needs to be a script to release ALL anchored objects in a document, similar to how Break All Text Threads works.

This script is very helpful, as you can release an anchored object with one click, but you still have to individually click on every single anchored object which is massively tedious.

https://creativepro.com/releasing-inlines/

Votes

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
community guidelines
Community Expert ,
Oct 27, 2023 Oct 27, 2023

Copy link to clipboard

Copied

What's wrong with the script that Marc Autret posted (see the answer marked as correct)?

Votes

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
community guidelines
Participant ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

Woah!  I didn't see there was a correct script.  This is phenomenal!

Votes

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
community guidelines