Remove Anchor Object in the Active document

I have a couple of InDesign CS4 documents which has Anchor many objects. I just want to remove/delete the entire anchor along with objects through Javascript. Can someone help me out on this regard?

That can be done with a simple search-and-replace -- see the Help on Searching for the code.
You can put this search-and-replace in a script, or save it in the Saved Query list.

Similar Messages

  • Call a function when the active document is closed

    Hi friends
    I have a portion of my script (at true a specific function) that I´d need to be executed every time the user close the app.activeDocument in Photoshop.
    I know there´s a Photoshop script called "Script Event Manager" where we can associate actions and scripts with events (like closing the document). I´d not like to use this script because..as I told...it´s not my entire script to be runned when closing a file..but only a function.
    Tried to search in the Script Event Manager for any event called "onClose" () but sure there´s nothing.
    How could I insert an event in the body of my own script that calls a function every time user close the active document?
    Thank you a lot for the help
    Best Regards
    Gustavo.

    As I said before the close event is really not that useful. In addition to the document already being closed the event descriptor will only have the path to the closed file if it was saved as part of the close event.
    But if you want to play around with this to see if it will be helpful to you here is one way. You will need to add the notifer. This only needs to be done once unless it is removed.
    app.notifiersEnabled = true;
    app.notifiers.add( "Cls ",new File('~/desktop/closeEventHandler.jsx') );
    Then for the event handler script, something like this.
    try {
        if (arguments.length >= 2) {
        var filePath;
        var desc = arguments[0];
        if( desc.hasKey( stringIDToTypeID('in') ) ) filePath = desc.getPath(stringIDToTypeID('in'));
        if( filePath != undefined ) alert( decodeURI( filePath ) );
    } catch (e) {}

  • Digitally Sign All Signature Fields in the Active Document

    I have a script which will sign a single digital signature field by the field name.
    I need to revise the script so it will sign multiple/all signature fields in the active document without having to put the field name in the script, as the field names will vary with each document.
    Can anyone please advise how to modify the script to sign all fields in the active document regardless of the field name?
    function myOtherTrustedFunction()
    app.beginPriv();
    // Get and login to security handler
    var oSigHdlr = security.getHandler( "Adobe.PPKLite" );
    oSigHdlr.login( "123","/c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx");
    // Setup Signing Properties
    var chk = this.getField("Checked");
    if (chk != null) {
    // Apply Signature and save back to original file
    var bRtn = chk.signatureSign({oSig:oSigHdlr, bUI:false, oInfo:{password:"123"}});
    app.endPriv();
    Any assistance will be most appreciated.

    Thank you for your help, the script will now count only the signature fields which have not been signed.
    I have added the second part of the script to then sign all of the blank signature fields.
    The script is only signing one of the digital signature fields instead of all of the blank signature fields.
    Can you please advise how I can modify the script to sign all of the blank signature fields?
    var count = 0;
    for (var i = 0; i < numFields; i++) {
        // Get the current field object
        f = getField(getNthFieldName(i));
        // If it's a signature field and not already signed, increment counter
        if (f.type === "signature" && !f.value) {
            count++;
    var myEngine = security.getHandler( "Adobe.PPKLite" );
    myEngine.login( "123", c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx" );
    // Sign the field
    f.signatureSign( myEngine,{password: "123"});

  • Minumum and Maximum pointsize in the active document with font name

    hi
    How to find the font with point size in active document and how to get the minimum point size and maximum point size used in the active document with font name
    Thanks in Advance.

    Okay, that does look good (without testing it). Does it do its job?
    I think it can be made a bit more efficiently by not running over all text frames, but rather over all stories in the document -- a small change, the rest can stay the same.
    You can also try turning the gathering of used data around. It appears you are now pushing every item immediately into your array, then weed out duplicates. (For my thoughts on the latter, see below!) It might be quicker and more memory-efficient to scan your present array to see if the new item is already in there, and only push when it's not. (Bonus points for a binary tree implementation -- the fastest possible way! But a linear search on the entire array, or on a sorted array and bailing out if you go "past" the current item, may be fast enough.)
    (On Weeding out duplicates; you might want to skip this, as it won't be necessary for the above:)
    Your function UniteSame sorts out and removes duplicates by comparing every item to every other one; then it sorts the array. An alternative can be to
    1. Sort the array
    2. Create a new empty one
    3. Push an item of the original onto the new one.
    4. Skip items of the original list while they are the same as the bottom one of the new list.
    5. Until you run out of items.

  • How can I print ONLY the active document?

    Whenever I go to File/Print the darn PSE 9 program sends all of the working files in the bin to the printer. I've searched online for 2 hours now looking for an answer.
    I like to work with having several to many files in the 'bin' and prefer to only print the active file I'm currently working on without having to close the 'working files' before I can print. How can I print ONLY the active document or file in the project bin? Please help, I've upgraded from PSE 3 to PSE 9 and really like the updated features, but this one pain in the neck default is getting the best of me.

    Thanks for your help, that works nicely. It is good to have control of the printer again.

  • Undable to drop tablespace ORA-01561: failed to remove all objects in the

    hi,
    i am unable to drop table tablespace how can i do that??
    please advise
    DROP TABLESPACE tbs_tp2 INCLUDING CONTENTS AND datafiles
    ERROR at line 1:
    ORA-01561: failed to remove all objects in the tablespace specified
    Thanks in advance
    siva
    chennai

    Have you tried dropping the objects individually? You can see which objects still belong to this tablespace by using the DBA_SEGMENTS view as shown below:
    SELECT OWNER, SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME
    FROM DBA_SEGMENTS
    WHERE TABLESPACE_NAME=tbs_tp2;HTH!

  • I have a new iMac running OS 10.9 when I use the Command S shortcut it no longer saves the active document it speaks it instead.

    I have a new iMac running OS 10.9.  When I use the Command S shortcut in any of my apps (numbers, text edit etc), it no longer saves the active document it speaks it instead.  How can I revert to the save shortcut function?

    have you looked in
    system preference->Dictiation & speech if it's assigned there?
    or system preference->accessibility if it's assigned there?

  • I try to 'Print booklet' and receive an eror that "the active document uses multiple page sizes..."

    I try to 'Print booklet' and receive an eror that "the active document uses multiple page sizes..." but all the pages on my document are in the same size (as far as I know)
    How can I deal with this eror?

    This seems to be a bug, and so far the only workaround I know is  to copy/paste everything into a new file.

  • How to Select the Document just back of the Active Document

    If there are 5 documents open in photoshop I want to select the document just behind or back of the Active Document , using script.
    One of my friend suggested me the bleow script, but it is selecting the previous document, not exactly the document back of the active document.
    please help me.
    var id85 = charIDToTypeID( "slct" );
        var desc21 = new ActionDescriptor();
        var id86 = charIDToTypeID( "null" );
            var ref11 = new ActionReference();
            var id87 = charIDToTypeID( "Dcmn" );
            ref11.putOffset( id87, -1 );
        desc21.putReference( id86, ref11 );
    executeAction( id85, desc21, DialogModes.NO )

    I had the same problem. I did not want to go back to the "last viewed" doc but to the doc opened before the active one.
    I use this on F1 key to go back to the previous opened document (index order -1).
    It works great.
    #target photoshop
    // Go back to the last opened doc. If it is the oldest opened one it does not give error window and stays on it.
    if(documents.length>0) {
        var thisIndexImage = getActiveDocumentIndex();
        var theDocs = app.documents;
        if ( thisIndexImage != 0 ) {
            var openedBefore = theDocs[thisIndexImage - 1];
            } else {
            var openedBefore = theDocs[0];
        app.activeDocument = openedBefore;
    } else {
        alert ("You need to have any opened documents to apply this script.")
    // Functions
    function getActiveDocumentIndex(){
         var ref = new ActionReference();
         ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
         return desc = executeActionGet(ref).getInteger(stringIDToTypeID('itemIndex'))-1;

  • How can I get the windowRef of the active document window?

    Hello,
    Hou could I get the ADMWindowRef of the active Document window in Illustrator CS4- CS5? I can not use ADMWindowSuite1  because is On Mac OS only.
    Thank you very much to Everybody.

    There's no API for this, not if you want to make use of it in a useful way. You have to write Windows API code to do it. I reccommend using Spy++ to suss out the structure. Frankly, it's pretty annoying. It'd be extremely helpful if the API provided this, but it doesn't.

  • How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document

    How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document uses multiple pages sizes and won't print.  My page sizes are all 10" x 10"

    Please post in the InDesign forums here http://forums.adobe.com/community/indesign/indesign_general. They will be able to help you.

  • How to remove unused objects from the webcatalog In OBIEE11g

    Hi,
    I want to delete unused objects from obiee11g catalog, i know in obiee10g it's working fine (i.e: we can do it via manage catalog then delete the unused objects) is there any way to do it automatically like RPD utility --->removing unused objects from Physical layer in RPD
    fyi: I don't want to delete manualy. i need somethink like button/link to find unused objects(report,filter,folder..etc) from my obiee11g catalog.
    Thanks
    Deva
    Edited by: Devarasu on Nov 29, 2011 12:06 PM
    Edited by: Devarasu on Nov 29, 2011 3:15 PM

    Hi,
    Checked with Oracle Support team and confirmed below points
    --> incorporated into the Current product and consider as BUG it may resolve future release
    --> Currently there isnt any automatic method to remove the unused objects like reports, filters,folder etc from catalog.
    Treated as Bug
    Bug 13440888 - AUTOMATICALLY REMOVE OF UNUSED CATALOG OBJECTS FROM WEBCATALOG
    FYI:
    SR 3-4984291131: How to remove unused objects from the webcatalog in obiee11g
    Thanks
    Deva

  • How do I remove an object from the foreground of a photo eg a fence?

    How do I remove an object from the foreground of a photo eg a fence?

    What version of Photoshop?
    If CC then try here
    Learn Photoshop CC | Adobe TV

  • How to get the active document file name using illustrator CS2 plugin code?

    I wanna take file name from active document using illustrator plugin CS2. Plz anybody help me..
    Thanks in advance..

    AIDocumentSuite::GetDocumentFileSpecification() should get you that information. Note that it will only work properly if you've already saved the document (or opened it from a file). I'm not sure what the result looks like if you're calling that on a new, unsaved file.

  • Modeless dialogs and the active document

    I have a modeless dialog (Qt) that contains a checkbox to toggle off and on annotations that our plugin draws.  When the user clicks the checkbox, it calls a function in the plugin code that ultimately makes a call to AIAnnotator->SetAnnotatorActive().  When passing in false, the annotations stop drawing, as expected.  But when passing in true, the annotations don't draw (the plugin doesn't even get the kCallerAIAnnotation message) until the modeless dialog moves or the Illustrator window gets focus.
    I have tried to force a redraw and a bunch of other things to try to get the annotations to start drawing, but none of them work.  One thing I found interesting (and is the root of the problem, I suppose) is that at the point the user clicks the checkbox in the modeless dialog, making a call to AIDocument->GetDocument() returns DOC?, which means there isn't an active document.  Without an active document, none of the calls to redraw the window or invalidate the current view will work.
    Have any of you experienced this before and come up with a solution?  I'm really at a loss on what to do.

    Thanks for the response.
    Maybe I'm not calling the AIAppContextSuite functions at the correct time, but they don't seem to do anything in this situation.  I'm pushing the context right before I display the Qt dialog (at which point I have a document and a view), but when the checkbox is clicked, calling AIDocument->GetDocument still indicates there isn't a document.  These click events happen in the Qt event thread, not the plug-in message thread, but I don't believe the click itself is the problem.

Maybe you are looking for