Skip navigation
Currently Being Moderated

export Indesign snippet

Apr 10, 2012 4:24 AM

Export each spread in indesign as indesign snippet without using grouping.

 
Replies
  • Currently Being Moderated
    Apr 10, 2012 4:36 AM   in reply to SangeethaRajeshkumar

    What, right now? Why should I?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2012 5:22 AM   in reply to SangeethaRajeshkumar

    If you post your sample codes, you'll get quick fixes....

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2012 6:11 AM   in reply to SangeethaRajeshkumar

    I searched and tried and cannot find a direct method to export a ungroupped objects in single snippet file.

     

    var obj = app.activeWindow.activePage.pageItems.everyItem();
    obj.exportFile(ExportFormat.INDESIGN_SNIPPET, File("E:/testing.idms"));
    

    This method also fails, it exports only the first item in the array.

     

    Any way you have to group it. So that you'll have it in a single file.

     

    Try this work around, Add a label to indicate to which layer it belongs to, and while importing it run a script to move it to its corresponding layers based on the labels that you assigned.

     

    Green4ever

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 1:32 AM   in reply to SangeethaRajeshkumar

    To add a label you could use the insertLabel method:

     

    myPageItem.insertLabel("KeyString", "ValueString");
    

     

    To extract it, do it like that:

     

    myValueString = myPageItem.extractLabel("KeyString");
    

     

    To use a value like the name of a layer, you could:

     

    myPageItem.insertLabel("Layername", myPageItem.itemLayer.name);
    

     

    To extract the layer name and apply it to the page item:

     

    myPageItem.itemLayer = app.activeDocument.layers.itemByName(myPageItem.extractLabel("Layername");
    

     

    Of course you can run into problems if the layer does not exist in the document where you place your snippet.
    In that case you have to add a new layer with the appropriate name to the document.

     

    app.activeDocument.layers.add({name:myPageItem.extractLabel("Layername")});
    

     

    Or it may be that the layer is there, but locked! Then you first have to unlock teh layer.

     

    Also: that easy approach will not take care for the "right" order layers are stacked, if they are visible or even locked. Does the rules of the source or the target document layer behaviour apply? You may or may not implement a routine to get that right. This is highly case dependend. If one or some of the layers already exist and you mix that with new added layers or you change the stacking order of layers you could easily contradict already established layer behaviour and wreck the layout of a whole document…

     

    Uwe

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

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