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
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
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.
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
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
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
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
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.
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
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.
Copy link to clipboard
Copied
Thanks a lot!
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 )
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
Copy link to clipboard
Copied
Ravi