How to break up with release script for anchor of the object

There are many objects related in a block of text

I select the text block. I want to release the related objects

Marc Autret method:
var a = app.selection[0].allPageItems, t;  

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

Jongware method:

n = app.selection[0].textFrames.length;
while (n >= 0)
{
     try {
          app.selection[0].textFrames[n].anchoredObjectSettings.releaseAnchoredObject();
     } catch(_) {}
     n--;
}

Vandy

Tags: InDesign

Similar Questions

  • should my time capsule be connected with a cable for backups, after the initial installation?

    should my time capsule be connected with a cable for backups, after the initial installation?

    If you mean that you have to keep your Mac connected to a Time Capsule via Ethernet for future backups, then the answer is no. Time Machine and time Capsule are designed to work over wireless for your Mac would just need to be connected to the wireless network provided by the time Capsule.

  • My safari has locked up with a request for verification of the property query.  What can be done to fix this?

    My safari has locked up with a request for verification of the property query.  What can be done to fix this?

    This is the shit that came.

    Force Quit Safari (cmd-option-esc) then restart Safari by holding down the SHIFT key.

    Sorry, wrong forum... question thought it was an OS X. In any case don't give them any info.

  • How to remove the selected area with a script that would ignore the fact if the selected area is transparent or the fact that it has no selection?

    Hello

    My friend works on an action, who would edit images by removing the white background color. However, there are a lot of images with transparent background or after some other actions have no selection who had to be removed. And now he is facing simple problem, simple remove this feature brings a lot of table and the error Stops.

    The ideal solution to this problem would be if it would ba a script who could remove the selection and ignore stops as no selection and transparent.

    Can anyone help with this one?

    Settle into the Photoshop scripts forum.

    With a script, you would just put your code in a try/catch block. This intercept errors such as the selection of a transparent area and do not stop your script:

    try{
         //your code here
         }
    catch(e){
         //either no code, or code to do something if you get an error.
    }
    
  • Need help with a script (o - o8) *, see the Virgin if there is no

    Hi all what I need help with a script I can't find an example.

    I'm trying to subtract 2 numbers and then multiply this product. (o o8) * one but I just want to do the calculations if all fields have the numbers IE field o, o8 of field and field one.

    Thank you in advance. I was stuck on this days searching the Internet.

    Assuming you want to affect the outcome of this calculation in another text field, use this code as a custom field calculation script:

    var o = this.getField("o").valueAsString;
    var o8 = this.getField("o8").valueAsString;
    var a = this.getField("a").valueAsString;
    if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a);
    else event.value = "";
    
  • Release of anchor all the objects/text images

    Dear all,

    It's my 1st question on AC (Adobe Community), so I'll explain what I need here in details and excuse me my little or even none experienced in coding, especially in Javascript.

    I have a book with many INDD files, these files have a lot of images and objects and text blocks are anchored to the main text area.

    I searched on AC for the way to free him from all my anchored object and the main text block text block. so I found the average script.

    I found her name "ReleaseAnyAnchor" created by 'Dave Saunders' to release the anchored object (graphics, text, else) but one by one. and it will take too much time to free myself from all the objects on the book. (the Script code is below)

    //DESCRIPTION: Release Inline & Anchored Items
    //Written by Dave Saunders, released on indesignsecrets.com
    
    
    (function() {
      if (app.documents.length > 0 && // must be a document open
      app.selection.length == 1 && // selection must be of single item
      app.selection[0].parent instanceof Character) { // selection must be anchored
      if (parseFloat(app.version) < 6) {
      releaseMe(app.selection[0]);
      } else {
      app.doScript(releaseMe, undefined, app.selection[0], UndoModes.entireScript, "Release Any Anchor");
      }
      } else {
      alert("Please select an inline item.");
      }
    
    
      function releaseMe(myPI) {
      var yePage = findPage(myPI);
      var startBounds = myPI.geometricBounds;
      myPI.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
      myPI.anchoredObjectSettings.releaseAnchoredObject();
      if (yePage != null) {
      myPI.move(yePage);
      }
      myPI.move([startBounds[1], startBounds[0]]);
      }
    
    
      function findPage(theObj) {
      if (theObj.hasOwnProperty("baseline")) {
      theObj = theObj.parentTextFrames[0];
      }
      while (theObj != null) {
      if (theObj.hasOwnProperty("parentPage")) return theObj.parentPage;
      var whatIsIt = theObj.constructor;
      switch (whatIsIt) {
      case Page : return theObj;
      case Character : theObj = theObj.parentTextFrames[0]; break;
      case Cell : theObj = theObj.insertionPoints[0].parentTextFrames[0]; break;
      case Note : ; case Footnote : theObj = theObj.storyOffset; break;
      case Application : return null;
      }
      if (theObj == null) return null;
      theObj = theObj.parent;
      }
      return theObj
      } // end findPage
    
    
    }());
    


    also, I found another script which release all of the graphic objects, but not objects of text frame. (I get it from AC, but I remember exactly the place where.)


    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();
                    }
                }
            }
        }
    }
    


    all codes work well for me, but I need to try to merge or make a new code [as I mentioned that I don't have experiences in JS, so I do not know how to compile a new code that do the 2 steps of the 2 codes.]


    my request is, could you please help me to do this new code, or merge to compile a new code in the new file.


    I saw this topic releasing objects anchored and want to make a new script.


    Please try to help me as soon as POSSIBLE because I need this script to all my object anchored to begin working on the output file.


    I need the code works on any version of INDESIGN.


    Thanks guys, waiting for you.


    AMR

    AHA. If you need test whether a line is an anchor. If this is the case, use. releaseAnchoredObject(), if it is not, the simplest is to make an anchor, then release it:

    if (pageItems[i].parent instanceof Character) {
        if (pageItems[i].anchoredObjectSettings.anchoredPosition !== AnchorPosition.ANCHORED) {
            pageItems[i].anchoredObjectSettings.anchoredPosition = AnchorPosition.ANCHORED;
        }
        pageItems[i].anchoredObjectSettings.releaseAnchoredObject();
    }
    

    It works, but I don't know if the results are what you're after.

    Peter

  • Action Script gets ignored when the object is not Visible

    I spent days trying to get help for that so I'll seriously be happy if someone has the answer.
    I have a simple drag and drop of the game user drop off items in a bag and they disappear obtaining or losing points as they.

    THE PROBLEM!
    Is not a little funny flash where it does not update the variable "score" (action is not all the script) because the object no longer exists! I tried to do without making objects disappear when dropped on the bag and updates the score normally.

    Someone at - there a way around this? I thought I'd put as a button that checks all the visible objects and establishes points in this way but I do not know where to start on this.

    Here is the code I put on each object...

    on {(press)
    StartDrag("");
    }

    on (release) {}
    If (_droptarget == 'Bag') {}
    setProperty (root.rangerssocks, _visible, 0);
    score = score + 1
    }
    on the other
    {
    StopDrag();
    }
    }


    Make sure that the score is a level _root variable and update that way. as you now, score is on the dragged item so it's a question of importance. in frame 1 of the movie root, add

    score = 0; (at the beginning that initializes your score to 0)

    then press the buttons make a
    _root.score += 1;

  • How to remove a line empty after an anchor of the table?

    We use FrameMaker 12 on Windows 7 (64-bit) platform.

    I'm working my way down to a chapter in the content of the training. I'm at halfway in the chapter, and - as fate would have - I need start a table at the top of a page.

    When I insert a table (with a caption/title at the top), FM creates an anchor at the top of the page. The space to the right of the anchor is a blank line.  In fact, I want the table to start at the top of the page without the white line to the right of the anchor.

    That's what I tried, with results:

    I put the cursor after the anchor and press DELETE.

    Result: The text * under * the table is set up above the table.

    I put the cursor after the last piece of text on the previous page and press DELETE.

    Result: The paragraph on the previous page Stoops to the next page on the top of the table, leaving a large empty space on the previous page.

    I change the start option (Table Designer) at the top of the column (or the top of the Page).

    Result: FM leaves the anchor where she was, move the table until the next page and leaves a completely blank page where the table used to be.

    Is it possible to just go up the table so that it is on the same line as the anchor?

    (And as a design tool problem, is there ALWAYS a reason why a content developer wants a complete line of vacuum over a table?)

    Thank you in advance,


    Tim

    Assuming that your para anchor has a spacing of X:

    • In the Paragraph Designer set it for tea by anchor, base: space: below the FMP: -x
    • In the table designer for the table, set the base: space: above: -x

    >... it NEVER is a reason why a content developer wants a complete line of vacuum over a table?

    A series of tables not run-together, sure. But the hack of negative space above there are quite often do suggests a design control.

  • How drag and drop a picture into a shape of the object?

    On my old Lion system that I used to be able to drag a picture from iphoto in the shape of the object open in Pages.  I can't be able to do more.  The system changed?  I tried to use Inspector (under help), but it won't let me access the file of the photo on the right.

    You can drag and drop a picture in a form in v4.3 Pages ' 09, but this can be done in any version of v5 Pages. Quite different applications, as well as more recent Pages has lost about 100 features that were in its antecedent.

    Check if you have Pages ' 09 v4.3 in your Applications: iWork ' 09 file. If so, use it.

    Pages v5 requires that you select a shape, and then on the Image tab in the right panel, you choose Image, scale to fill fill, and then select your image for the background. You cannot select this image from the inside, but you can add text to the form that will appear on your image.

  • How can one XP PRO/HOME ED be saved to work with older hardware for restoration after the replacements of material

    OLD Machine equals zero reactivation OEM support. How can I save four other machines to stop the death of my portfolio. Back up the hard drive just ISO or other wizardry doesnot work.

    It is not possible.

    You are usually "" the operating system for the same pc, backup data will not

    working with 'new hardware pc' or main pc components. In addition, a pc that is redesigned

    with 'a few new pieces' xp will require a re-registration for the OS...

  • Help with dynamic scripting for drift property

    Hello

    I try to get the list nodes children, then loopthorugh the nodes to do some calculations in a property derived by using dynamic scripts. I tried with the below script.

    var childEnumerator is node. GetChildEnumerator();

    While (childEnumerator.MoveNext ())

    {

    var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");

    Print (propvalue);

    }

    While evaluating this script, I get an error below. No idea what I'm missing here?

    DRM-16008: there was a calculation Script Custom.TotalSalaryExp for EMP_Zone/Emp/PPD1 property error: TypeError: 'GetChildEnumerator' is not a function

    Please help me. Thank you fr your cooperation

    Kind regards

    Nathalie

    Try this instead...

    var childEnumerator is node. GetChildEnumerator();

    childEnumerator.MoveNext ();

    While (childEnumerator.GetCurrent ()! = null)

    {

    var varValeurProp = childEnumerator.GetCurrent (). PropValue ("Custom.Salary");

    Print (propvalue);

    childEnumerator.MoveNext ();

    }

  • How to highlight an array of layers Extend script for sequels (as the mouse)?

    Can someone please share how to select a layer in after effects, like the mouse click.

    var activeItem = app.project.activeItem;

    var curTime = app.project.activeItem.time;

    var myLayers = activeItem.layers;

    var layersAtTime = [];

    for (i = 1; i < = myLayers.length; i ++) {}

    {if (myLayers [i] .activeAtTime (curTime))}

    layersAtTime [layersAtTime.length] = myLayers [i];

    }

    }

    for (j = 0; j < layersAtTime.length; j ++) {}

    layersAtTime [j]. ???

    }

    Now how to highlight layers in the layersAtTime table in after effects just like the mouse click Select. ??

    If you do not need to do other thing with these layers (IE if you want only to select), you can simply do:

    for (i = 1; i<>

    myLayers [i] .selected = myLayers [i] .activeAtTime (curTime);

    };

    He made sure no active layers are not selected.

    Xavier.

  • Problem with Powershell script for vSpherePowerCLI

    Hello

    I am creating a script that clones of a VM environment VMware-model as much as I need.

    I found a script online, that should do it:

    ____________________________________

    SE connect-VIServer-Server 192.168.0.1

    Get-VMHost

    $host1 = "192.168.0.2".

    $template = 'template1 '.

    $datastore = "data1."

    $customization = "templtest".

    for ($i = 1; $i - 3; $i ++)

    {

    $tempvm = 'vServer -' + $i

    $array += $tempvm

    }

    foreach ($vm in $array)

    {

    $vm = New - VM - name $vm - model $template - $host1 - $datastore - OSCustomizationSpec $customization data store host - confirm: $false

    }

    _____________________________

    for example, this script should create 3 Template1 VMs with the names: vServer-1, vServer-2 and vServer3.

    But it creates a virtual machine with the name vServer-1vServer-2vServer-3.

    Can someone help me with this problem?

    Is there something wrong in education for?

    Thanks in anticipation,

    Alex

    Hi Alex,

    Before the statement, you must insert the following line:

    $array = @()
    

    This will initialize the variable $array as an empty array.

    Best regards, Robert

    Post edited by: RvdNieuwendijk

  • I purchased / have a serial number for acrobat pro - how to download it with/without pay for it again? !

    I bought acrobat pro in nov - has been sent to a serial number has been charged - and just today sent a serial number.

    I want to download the product, but seems to be asked to pay for it, once again

    How can I download the product with my serial number without pay again!

    Thank you

    You can download a free trial here: https://www.acrobat.com/free-trial-download.html and activate it with your serial number.

  • How to break in a SQL script.

    I'm using Oracle 11 g. I run a sql script called Queries.sql. The script has a lot of create and insert. I want to put a few delays in the execution of the script (e.g. delays 5 seconds) for that I can watch the output because the script is run. How to do this?

    Hello

    EXEC  dbms_lock.sleep (5);
    

    goes into pause for 5 seconds. You don't have any EXECUTE privileges on dbms_lock; Otherwise, log in as SYS and grant them or ask your DBA to grant them for you.

    Another thing to do is the SQL * Plus command:

    ACCEPT  dmy  PROMPT "Press [Enter] to continue ..."
    

    who waits indefinitely as the user presses the key [Enter] before continuing.

    Published by: Frank Kulash, April 26, 2011 19:59

Maybe you are looking for