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
Thanks for your reply. But I am new to scripting, so i am not able to make that script completely. So could you plz give me the full code of the script?
For more information:
The file contains Inline anchored object and custom anchored objects in the table. And there is no link between frames. Each page having separate frame.
Hi Pathi,
Please try the below js code is simple way to remove the anchored object for all the page.
var myDoc =app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat= "^a";
myDoc.changeText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
thx
csm_phil
Hi Path,
Your wrongly entered the code myDoc.ChangeText() instead of myDoc.changeText();
Please copy my previous code and run once again i think you typed wrongly.
Please copy and paste estk and run the script.
var myDoc =app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.findWhat= "^a";
myDoc.changeText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
mr.pathi wrote:
Hi CSM,
Thanks for your help. I copied this code and i run this script but while running this I am getting an error like below:
JavaScript Error!
Error Number: 1
Error String: changeText
File: C\...
Line 4
Source: myDoc.ChangeText();
Could you plz check and let me know. Thanks in advance.
thx
csm_phil
Hi CSM,
I am sorry, I only copied the content from here to my script. So there it was correct only. When i replied a mail to you that time only i entered wrongly
the code myDoc.ChangeText() instead of myDoc.changeText(); .
So my script is correct as what you gave me. Its showing me the error:
JavaScript Error!
Error Number: 1
Error String: changeText
File: C\...
Line 4
Source: myDoc.changeText();
sorry for the inconvenience. Thanks in advance.
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
Hi winterm and CSM,
@winterm : you are right. Its working fine as you said, its just deleting all anchored images also. But i dont want this, I want that images and should be placed in same place. It should just release from anchored.
I have below script, even its working for normal file but its not working for the files which are need to release.
if(app.documents.length!=0) {
var ad = app.activeDocument;
var pgit = ad.pageItems;
var pgitlg = pgit.length;
var objprocessed = 0;
if(pgitlg !=0)
{
for(i=0; i<pgitlg; i++)
{
if(pgit[i].getElements()[0].constructor.name == "TextFrame")
{
var tfg = pgit[i].allGraphics;
var tfglg = tfg.length;
for(j=0; j<tfglg; j++)
{
var rec = tfg[j].parent;
rec.anchoredObjectSettings.releaseAnchoredObject();
}
}
}
}
}
I have a file which i need to release from anchor, plz let me know how to share that file through our forum.
thanks
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 the text in the white box in post #11. Use ESTK (ExtendScript Tool Kit) or any text editor and paste the text from above. Save the file as plain text with the .jsx extension. Place the file in HD/Applications/Adobe InDesignCSx/Scripts/Scripts Panel. Restart ID and with a file open, go tom menu Window>Utilities>Scripts and double-click on the script to run it.
> .. Restart ID ..
Not necessary at all to quit ID! As soon as you place a new script in the ascrts folder, you'll see it magically appear in the Scripts Panel. (Also, if you saved it at what you think was the right place and it does not appear, you used the wrong location.)
That explains it. :)
I'd love to hear Adobe's explanation, though, about this stuff lagging behind in Illustrator, while the Script Panel and its behavior has been unchanged since *at least* CS, and probably before that as well. (For once that's actually a GOOD thing to leave exactly as it is!)
North America
Europe, Middle East and Africa
Asia Pacific