Ungroup all groups to an indesign document

Hello

I'm developing an indesign extension with CS extension builder 2 and flashbuilder 4.6 and I want to separate all the groups of a document.

I tried:

function breakgroup (who) {}

for (var g = 0; g < qui.length; g ++)

{

{if(qui.) Item (g). Locked)}

which. Item (g) .locked = false;

}

{if(qui.) Item (g). Groups)}

degroup(qui.) Item (g). Groups);

}

which. Item (g). Ungroup();

}

}

breakgroup (App.Documents.Item (0).) Groups);

but it is not ungroup the group, there is a better way?

Thank you

Simon

Hello

Try this (put loop backwards):

for (var qui.length - 1; g = g > = 0; g-)

{

...

}

Tags: Creative Suites

Similar Questions

  • How to add legend for all images in the indesign document using indesign javscript

    I want to add the legend for all images in the indesign document...

    It's my code... im being of error like:

    invalid parameter.

    capset(2) ();

    function capset()

    {

    var doc = app.activeDocument;

    var myPicture = doc.allGraphics;

    var f, i, myCaption;

    While (PIC = myPicture.pop ())

    {

    f = pic.geometricBounds;

    Add a frame to the parent of the image, which is a Page

    myCaption = pic.parent.textFrames.add ();

    define the position and size of the legend

    myCaption.geometricBounds = [[2], [1], [2] Go + 3 GB [3]];

    Add the contents of the placeholder

    myCaption.contents = "Caption";

    PIC.parent.groups.Add ([pic, myCaption]);

    }

    }

    Hello

    Runing a code with your doc that you note possible occurrences (groups, the elements anchored, locked, etc items)

    This presupposes to exclude grouped and docked:

    capset ();
    
    function capset()
    {
    var
      mDoc = app.activeDocument,
      // anchored or grouped items excluded
      myGraphics = mDoc.splineItems.everyItem().getElements(),
      picContainer, gb, myCaption;
    while(picContainer = myGraphics.pop() )
    {
      // exclude empty frames
      if (!picContainer.graphics.length) continue;
      gb= picContainer.geometricBounds;
      // add a frame to to picture's parent, which is a Page
      myCaption = picContainer.parent.textFrames.add ();
      // set position and size of the caption
      myCaption.geometricBounds = [gb[2], gb[1], gb[2]+3, gb[3]];
      // add placeholder contents
      myCaption.contents = "Caption";
      mDoc.groups.add ([picContainer, myCaption]);
      }
    }
    

    Jarek

  • Select all content in the indesign document to attach the script

    I have a script that does something useful for my document. But he always need chose the part of the document, as

    If (app.selection.length > 0)...

    Could you ask me how to select all the pages in the indesign document. I have a lot of pages. And I have a lot of files .indd
    I tried to use app.activeDocument.pages.item (0) .allPageItems; but it is not the effect of page = ( )

    Maybe I can use loop 'for', but perhaps there is a function of selection of all the document, is not only one page

    Thank you

    Of course:

    myPages = app.activeDocument.pages.everyItem () .getElements (); Table of references to the pages of the document

    for (var k = myPages.length - 1; k > = 0; k-) {}

    myPages [k] .allPageItems = myItems;

    for (var j = myItems.length - 1; j > = 0; j-) {}

    processItem (myItems [j]);

    }

    }

    It treats everything from BACK to front, which is usually the security approach and is potentially a bit faster that the other direction.

    You must always write the processItem function.

    Dave

  • Ungroup all groups on a layer (JavaScript) active.

    Does anyone know how you would you unlink all groups on a layer active with JavaScript?

    looking for "Recursion", check this thread, Mark has an example of recursion of layers and groups.

    http://forums.Adobe.com/message/3387938#3387938

  • Hello I have PC and pay monthly. We are a small company. Question 1: For two years I have a full subscription to Adobe all programs. But the other day I would open an another user InDesign documents and could not open this with the error message: the

    Hello

    I have PC and pay monthly. We are a small company.

    Question 1: For two years I have a full subscription to Adobe all programs. But the other day I would open an another user InDesign documents and could not open this with the error message: "the document is done a new version than my version of InDesign. How should I do to upgrade my version to a version more recent?

    Question 2: I already have a license to use the software on two computers. Am I not allowed to use the same version I've taken down on adobe.com til two computers or terms here.

    Sincerely

    Stefan Svensson

    Hello

    Please see update requests in your desktop CC application.

    CC Adobe license can be activated on 2 machines using the same Adobe ID, but only one at a time.

    Reference: licenses and terms of use | Adobe

    Kind regards

    Sheena

  • Ungroup all the groups, and then create a single group

    Hey

    I can't get a script together where I can disassociate all groups in a document, then put everything under one group. Everyhting I work with as a single layer has, but for some of the arts that I am importing were groups within groups ect. To perform some actions, I did well after that I need everything that he in one group.

    I searched for an answer and found this (Carlos Canto wirtten)

    separate the function (whereToUngroup, group) / / where to separate them? layer, document, another group?

    {

    for (i = group.pageItems.length - 1; i > = 0; i--)

    group.pageItems [i] .move (whereToUngroup, ElementPlacement.PLACEATBEGINNING);

    }

    But I can't make it work.

    OK, it's just...

    Features 101 - you do not to change anything, you assume that build one (or someone else) and to use and reuse. You simply provide the parameters of that function was built to receive.

    to call the function (to use) to provide your own parameter names, they failed to match the original function names.

    var myGroup = blablabla... the group to dissociate

    var myDestinationGroup = blah... the group where you want the elements once separated, it could be a layer or a Document

    Unlink (myDestinationGroup, myGroup); call the function

    Since you are new to scripting and new here, I suggest to start good and mark questions as "correct" (or answered, I don't remember) whenever you get a satisfactory answer to a little close the thread, you don't have to if you think that you don't have the answer you are looking for.

  • Dear InDesign professionals, I have a problem with an InDesign Document.

    Dear professional inDesign,

    I have a problem with an InDesign Document. While opening, ID crashes down. I tried all the options in your HelpCenter, tried to open it in several applications, several Mac and PC. No luck. Is it possible to open it?

    This document is quite important vor an architecture-projekt.

    Thank you very much!!!

    Greetings,

    Markus

    I'm afraid that I'm not having luck-getting an error code 5 even after running the recovery tools, that I have. I open in a text editor and he was able to read some version information, or at least what resembles the version information, and it seems that it might have been converted from CS to CS2 to CS3, but when generating 443, which was the first production or the latest beta version (do not remember at this point) , but that doesn't help much.

    At this point the only suggestion that I have left is the Markzware recovery service company paid: Bad InDesign or Quark File Recovery submission form

  • I put 240 photos in an InDesign document using mini bridge.  Is there a way to hide the photos I used after I have put in my document?

    I put 240 photos in an InDesign document using mini bridge.  Is there a way to hide the photos I used after I have put in my document?

    I think Willi, and I even read your question differently. I thought you wanted to hide the images in Mini Bridge once they have been placed in InDesign so that you could keep track of those who you have (if you put twice the same image). If you want to hide in InDesign (as Willi read the question), his suggestion is very good. Another alternative is to use the shortcut to hide (command 3 on Mac OS), after putting the images, but before you click next to deselect them.

    I do not use Mini Bridge, so I can't help you there. If you want to use the full version of the bridge, you can use a Move command to move the selected items to another folder (temp), where they will not appear in your current folder. You can move after that that they all were placed. A bit of a hack, but it could work.

  • apply a clipping for each top-level group mask in the document

    Sample file: https://drive.google.com/file/d/0BzEoJSYDhH_WcXhIalFRTk9qOGc/view?usp=sharing

    We can assume:

    Art • grouped on configurations with a line called die.

    • All groups exist on "Layer 1"

    I am a loop in groups and work with groups who has relatives is "layer". I have to loop through all the groups in the document, but when I created the clipping mask creates a new group and live my loop. I am now a loop only in groups of "Layer 1"and moving them to a new layer before the clipping mask. My script is breaking after the Group has been moved to the new layer. I have a bunch of alerts in there for debugging.

    #target Illustrator
    
    
    var idocX = app.activeDocument;
    var li = idocX.layers;
    
    
    function meetTheParents(PageItem){
      if (PageItem.parent.typename = "Layer"){
      return "Layer";
      } else if (PageItem.parent.typename = "GroupItem"){
      return "Group";
      } 
    }
    
    function isLayerFree(layer){
      if (layer.locked == false && layer.visible == true){
      var gpa = layer.parent;
      isLayerFree(gpa);
      return true
      } else {
      return false
      }
    }
    
    
    var trLyr = li.add();
    trLyr.name = "TRASH";
    var l1 = li.getByName('Layer 1');
    for (j = l1.groupItems.length -1; j >= 0; j--) {
      app.executeMenuCommand ('deselectall');
      var iGroup = l1.groupItems[j];
      if (iGroup.hidden==false && iGroup.locked==false) {
      if (meetTheParents(iGroup) == "Layer"){
      if (isLayerFree(iGroup.parent)){
      iGroup.move(trLyr, ElementPlacement.PLACEATBEGINNING);
      // set die variable to die in current selection
      alert ("Group " + j + " moved to trash layer");
      alert ("trash layer path items length = " + trLyr.pathItems.length); // I'm getting '0' here even though I just moved items into it.
      var die = trLyr.pathItems.getByName('proofLine'); // script breaks here
      alert ("Die identified for this group");
    
      die.move(trLyr, ElementPlacement.PLACEATBEGINNING);
      for (a = 0; a < trLyr.pageItems.length; a++){
      var thing = trLyr.pageItems[a];
      if (thing.hidden==false && thing.locked==false){
      thing.selected = true;
      }
      }
      var sel = idocX.selection; // get selection
      alert (sel.length + " items in current selection.");
    
      // make clipped group of die with art inside
      if (sel.length==2) {// continue only if 2 objects are selected
      var igroup = idocX.groupItems.add(); // add a group that will be the clipping mask group
    
      var imask = sel[0]; // the mask is the object on top
      var ipath = sel[1]; // the "drawn object" is at the bottom
    
      var idup = imask.duplicate(); // duplicate the mask, to later get the fill and stroke to apply to the clipping path
    
      ipath.move (igroup, ElementPlacement.PLACEATBEGINNING); // add both path to the group
      imask.move (igroup, ElementPlacement.PLACEATBEGINNING);
    
      imask.clipping = true; // make the mask the clipping path
      igroup.clipped = true; // clip the everything in the group to the clipping mask
    
      if (idup.filled == true){
      imask.fillColor = idup.fillColor; // add fill color, same as the dup
      }
      imask.stroked = true; // stroke the mask
      imask.strokeWidth = idup.strokeWidth; // add stroke width, same as the dup
      imask.strokeColor = idup.strokeColor; // add stroke color, seme as the dup
    
      idup.remove(); // remove the duplicate
      }else { // show this message if other than 2 objects are selected
      alert("Select both, the Mask and the object that needs to be 'inside'.\rThe Mask needs to be the top most object.");
      }
      app.executeMenuCommand ('deselectall');
      igroup.move (l1, ElementPlacement.PLACEATBEGINNING);
      }
      }
      }
    }
    trLyr.remove();
    

    Inside of my plu script that it breaks in silence, in this example script is for me a 'no such item. There should be such an element, I just put there. Once the script completes, the Group has been moved, which means that the named path is right where it should be.

    Let's see if this works:

    #target illustrator
    function test(){
        if(app.documents.length < 1){
            return;
        }
        var doc = app.activeDocument;
        var lr = doc.layers[0];
        for(var i=0; i		   
  • How do I change an OpenType font to small capitals caps in my cc InDesign document?

    Greetings, community. It would be great if I could discover how to change the caps of an OpenType font to small capitals in my cc of InDesign document. It's a simple question.


    To be more exact, I have a piece of 18 pages that contains stage directions uppercase in brackets, I would change to small caps. The font that I use is an OpenType, Minion Pro, with small capitals.


    Another thing is, ideally, I'd like to be able to do it without change in capitals in the document and also, for not having to convert the caps to lowercase in order to.


    My source document (that I placed in my InDesign document) is Microsoft Word for Mac 2011.

    I go to Microsoft to know how in Word, but could not find a solution for Word for Windows.

    I tried their solution in all cases (a macro), but it did not work.


    Thank you very much. It's great to be in InDesign, even though I had my good years with QuarkXpress, which will become impossible for me.


    Morty Sklar

    You are missing a parenthesis at the beginning of the find which, according to me. Here, it works with all small caps OpenType.

  • Photoshop CS5: Shots of the menu bar on cintiq 21ux I work with photoshop cs5 on a Wacom Cintiq 21 ux and it has always worked great. But all of a sudden the documents, I work in a wink from the above menu bar and I can't go back there. It covers only the

    Photoshop CS5: Shots of the menu bar on cintiq 21ux I work with photoshop cs5 on a Wacom Cintiq 21 ux and it has always worked great. But all of a sudden the documents, I work in a wink from the above menu bar and I can't go back there. It covers only 2/3 of the cintiq. I installed the drivers from the wacom and installed photoshop again, but the problem is not resolved. It's very frustrating because it is almost impossible to work this way. I hope you can help me. I have Yosemite on the iMac, and it worked correctly. The problem occurred suddenly. I reinstalled the driver for the Tablet and photoshop cs5, but it does not solve the issue. I have a multiple display set in place. All other applications work fine (corel painter, illustrator, indesign). It's almost as if there is an invisible magnetic line on the screen where align with the document and the other tabs in the workspace. Now, I bought and installed cs6 and the problem is still there. Can you give some advice? Is this a known issue? I don't know if it ' s a problem caused by Wacom, Photoshop or Apple. Help, please. Thank you.Schermafbeelding 2015-03-16 om 21.07.50 (2).png

    I suggest that you take a look at this thread and see if something is a help to you: problem window CS6 on Cintiq on OSX Yosemite

    Benjamin

  • Batch to change the page size of InDesign documents

    I have about 300 documents in InDesign (2014 cc, Mavericks) a page of various page sizes. Each page is wider than 4 inches and 4 inches larger than the content of the page. The content is in middle of the page - actually make a margin of 2 inches (but with no margin guides) around the content. What I need to do, is get the page of all documents will have to be a specific page size, 7,125 "x 9.75".

    I was able to accomplish this by putting all the docs in a book, make a master page 7,125 "x 9.75" on a doc, synchronize the other docs and then opening each doc and apply the master page. The last piece was a bit a lot of work and I would like to avoid it in the future.

    Could write a script that opens some InDesign documents (in or not in a book) and changes the various sizes of page to the necessary size? I've never written scripts before, so no idea if it's possible or how to do it.

    I put the following on another forum and got help, but it took that I have control over the creation of the original documentation. And I did not. "Is there a way to globally apply a master page to all pages of all documents in a book?

    Any help is greatly appreciated.

    Hello

    What is your requirement

    var myFolder = Folder.selectDialog("Select the Folder contains Indesign Files")
    
    var myFiles = myFolder.getFiles("*.indd")
    
    alert("Total Indesign Files: " + myFiles.length)
    
    for(i=0; i
    

    Concerning

    Siraj

  • Delete all groups and layers that are turned off, even if they are locked

    Hello

    I need help with a script that will do the following:

    Delete all groups (including the layers inside) and layers so they are not visible - with the following requirements

    a. even if the group or layer is locked

    (b) even if the layers within the group are locked

    c. same layers within the group are visible, although the parent group is off

    Then... the required logic would be

    Is it group or layer turns off? Yes, then delete all independently of any other thing, OTHERWISE move on to the next layer/group

    Basically, I have a lot of groups and layers here and I want to analyze the layers to leave just the layers that are visible in the final document. Visible merge or flatten the will does not work as I want to keep visible and visible layers. Layers remove hidden does not work. And file/scripts/deleting empty layers does not work because the layers are not empty. They are simply not necessary.

    In collaboration with CS6.

    Thank you

    The other is round, but this should unlock all layers, after that delete hidden layers should work.

    // unlock all layers;
    // based on code to link layer masks by paul riggott;
    // 2014, use it at your own risk;
    #target "photoshop-70.032"
    app.bringToFront();
    if(app.documents.length != 0) {
      unlockLayers();
      };
    ////// unlock layers //////
    function unlockLayers(){
      var ref = new ActionReference();
      ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
      var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
      var Names=[];
      try{
      activeDocument.backgroundLayer;
      var i = 0; }catch(e){ var i = 1; };
      for(i;i		   
  • Detect changes in the Indesign document

    Hi all

    Is it possible to detect changes in the Indesign document? Any help will be appreciated.

    -Thanks in advance

    Learn about the architecture of the events.

    Substances

  • Several items may be in an indesign document?

    I have an indesign document with several articles in it. I did articles using the Articles Panel. How can I add these items to a folio? When I add an article to a folio with folio builder Panel, he added the entire document, even if I used the Articles to specify Panel than, say, pages 2-5 are an article entitled "family issues".  Is an article should be a separate indesign document to be added to a folio?

    On a more general level, I have not seen anything in the DPS literature which explains what is an article, what can/cannot be an article, etc.. I think that would help me. Thanks to anyone who can answer this question.

    Currently, this is an article by document. INDD. (Two INDD if you plan to do dual orientation)  The Panel 'items' is more directed to epub and html export.

    The concept of the "article" (with respect to the Digital Publishing Suite) was much easier to understand when he was earlier called a 'stack' in the draft.  The concept is that each page of your paper stacked on top of eachother to form a single article.  You article InDesign file contains all of the pages of this particle 'stack '.

    Think of it in terms of a magazine.  Each "article" has its own section in the viewer and therefore to have the InDesign document (including all pages of this particular article).  All of these different items or InDesign documents come together to make a "folio" or issue of your magazine.

    My suggestion would be to familiarize yourself with the workflow to understand what is and is not supported in Indesign.  Some great videos are on the page "getting started with the DPS.

    http://help.Adobe.com/en_US/digitalpubsuite/using/WS67cb9e293e2f1f60174dc2eb12f2ca67c28-80 00.primeras html

Maybe you are looking for