Skip navigation
mr.pathi
Currently Being Moderated

Release all anchored objects at once

Dec 4, 2011 5:50 AM

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

 
Replies
  • winterm
    176 posts
    Sep 16, 2010
    Currently Being Moderated
    Dec 4, 2011 2:00 PM   in reply to mr.pathi

    it seems your question already answered.

    take a look here:

    http://forums.adobe.com/message/2609468#2609468

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 4, 2011 11:22 PM   in reply to mr.pathi

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 1:01 AM   in reply to mr.pathi

    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

     
    |
    Mark as:
  • winterm
    176 posts
    Sep 16, 2010
    Currently Being Moderated
    Dec 5, 2011 2:03 AM   in reply to mr.pathi

    hi Pathi,

    Phil's script works, so better take a second look for copy-paste or somewhat errors on your side. Unfortunately, it not just releases anchores, it deletes them. This is not what you want, if I got your request.

    Maybe Phil could adjust his code by chance?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 2:05 AM   in reply to mr.pathi

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 3:04 AM   in reply to mr.pathi

    Hi Pathi,

     

    i have tested the above js code its working fine, But still i dont know what is your expectations. Can you please provide the snapshot before and after.

     

    thx

    csm_phil

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 4:26 AM   in reply to csm_phil

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2011 4:56 AM   in reply to Marc Autret

    Cute! But a little hard to debug!

     

    Is it ok to rely on the order of the Javascript interpreter like that?

     

    Ariel

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2012 7:41 PM   in reply to Marc Autret

    Hi guys,

     

    Could some one please send me the .jsx file to release all anchors? I'm really struggling here, am new to scripting and can't figure it out! Or is there somewhere I can download it?

     

    Thanks so much

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 9:05 AM   in reply to riss_85

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 10:31 AM   in reply to Larry G. Schneider

    > .. 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.)

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 10:36 AM   in reply to [Jongware]

    I guess I'm too used to AI which requires a restart to add the file to it's list.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 10:47 AM   in reply to Larry G. Schneider

    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!)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points