Duplicate object into multiple selected frame

I’m looking for a script that will duplicate the selected object or the content of the clipboard into multiple selected layers inside a document.
I have not find any discussions around this, but I’m asking if anyone have already seen such script.
Thanks
Jean-Claude

Jean-Claude try the following one:
1. Should work with a single object, multiple objects, group
2. Should alert a warning, if you select nothing or select some text
3. Will not honor, if layers are hidden or locked
Does it work for you?
// duplicate on different layers _b02
// by Kai Rübsamen, credits to Hans Haesler
// vorbeugenderweise das Anzeigen von Dialogen aktivieren
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
// prüfen, ob ein Dokument geöffnet ist
if ( app.documents.length == 0 ) {
    alert ( "Warning\rOpen a document!" );
    exit();
// die Auswahl speichern ...
var allSel = app.selection;
var nItems = allSel.length;
// und prüfen
if ( !nItems ) {
    alert ( "Warning\rSelect something!" );
    exit();
if ( nItems == 1 && app.selection[0].hasOwnProperty("baseline") ) {
    alert ( "Warning\rDoes not work with text. Select only frames!" );
    exit();
var curDoc = app.activeDocument;
var allLayers = curDoc.layers;
var nLayers = allLayers.length;
// eventuell vorhandene Dialoge entfernen
try {
    app.dialogs.everyItem().destroy();
catch (e) {
var layerNames = new Array();
for ( var i = 0; i < nLayers; i++ ) {
    layerNames.push( allLayers[i].name );
// eventuell vorhandene Dialoge entfernen
try {
    app.dialogs.everyItem().destroy();
catch (e) {
// den Dialog vorbereiten ...
var dlogCheckList = new Array();
var aDialog = app.dialogs.add({ name: "Duplicate object to selected layers", canCancel: true });
with ( aDialog ) {
    with ( dialogColumns.add() ) {
        with ( dialogRows.add() ) {
            staticTexts.add({ staticLabel: "active = duplicate"} );
            for ( var n = 0; n < nLayers; n++ ) {
                with (dialogRows.add()) {
                    dlogCheckList.push( checkboxControls.add({ staticLabel: layerNames[n] }));
// ... anzeigen und die Wahl des Anwenders anwenden
if ( aDialog.show() == true ) {
    for ( var k = 0; k < dlogCheckList.length; k++ ) {
        var curCheckBox = dlogCheckList[k];
        if ( curCheckBox.checkedState ) {
            var curLayer = curDoc.layers.itemByName( layerNames[k] );
            for ( var i = nItems-1; i >= 0; i-- ) {
                var curSel = allSel[i];
                curSel.duplicate( curLayer );
    aDialog.destroy();
else {
    aDialog.destroy();
–Kai

Similar Messages

  • Change Selection fields into Multiple Selection

    Hello,
    I would like to know if it is possible to change a standard Selection fields box into a Multiple Selection box.
    Example:
    In VA05, I have this (Further Sel.criteria > PO number)
    I want it to be like that (like in VA05N)
    Therefore, when I click on the Multiple Selection button, I have all the standard options as shown below:
    Any hint how it can be done would be appreciated.
    Thanks
    Regards

    click on 'Select Ranges' and you can able to eneter multiple ranges as you are looking.

  • How to Split java.util.Set object into multiple objects?

    Hi All,
    I'm having a collection of items in a Set. Assume that i'm having 10,000 items in Set A.
    Now i like to split the Set into multiple Set or Array such as each set or array consist of 100 records. i.e whenever
    i get more items i want to split them into mutiple set or array.
    Is there is any Java Api doesn't this function? or any other way to achieve this?
    Thanks,
    J.Kathir

    Iterate through them, placing them into different new collections.
    It may be easier to add the Set to a List, and then call sublist() a few times on the resulting List.

  • Pasting multiple objects into frame

    Greetings everyone
    I was wondering if someone could shed some light on how to best paste multiple objects into a single frame.
    Mainly, I'm trying to nest objects that form a part of a newspaper article header; since it's a design element that keeps repeating with each single article I don't want to spend time with manually positioning the elements each time--it's time consuming and prone to sloppiness.
    Unfortunately, the base frame will have about three objects that need to be nested within it. Once I paste one object into a frame, the next time I do `Paste into`--the content (previously pasted object in this case) just gets overridden.
    I've read that, to paste multiple objects into a single frame, one should group the objects first. Now this works pretty well for getting them into the frame, but leaves me with no options to position them relative to the frame. I can't move or position an object individually and I have no option to ungroup them once they've been pasted.
    Here's a small mock-up to depict my peculiar predicament:
    Ideally, I'm aiming to have the main header frame to fit the content of the nested objects and for it to be flexible enough that I can quickly span it across multiple columns as per article requirements.

    !kRON wrote:
    For items that are part of the group, their (X,Y) location coordinates are relative to the document--neither to the group nor the parent frame. The group itself has coordinates that are relative to the parent frame (X+ offset, Y+ offset). I can select the group and the parent frame and use the align to selection options. For individual items, I cannot make a selection of both them and the frame, only between items that are part of a group. I loose options to align an individual item relative to the parent frame, which means I have to drag them around and rely on smart guides.
    I've tinkered around some more and it'd appear it's not possible to lay out the elements as I imagined. So I have to resort to grouping the items that would form a frame and pasting them into a frame. If multiple frames have to be members of a single frame I'd have to group the frames and paste them into the single frame and so on.
    Based on my layout mock-up, I'd end up with 3 frames within the header frame:
    Article header
    Heading
    Article type
    Separator
    Article heading
    Title
    Footer
    Author
    Shape
    Based on experience, should I go with this or stick with the old fashined moving around of loose elements? Will it be a lot of work to maintain resizing and repositioning of the various items and their frames once I start changing the width and height of the header frame or will it save me some time?
    I'm not a working designer or production worker, so anything new takes me longer than I think it should, because I don't have a rich reservoir of quick methods at my fingertips.
    Your description above interested me, because I've been wrestling with the annoying limitations of manipulating and adding compound objects in anchored frames. For many situations, it's probably simplest to assemble each iteration of a compound object, that introduces a new element, outside the anchored frame, then group the elements and paste the grouped object into the anchored frame.
    However, the arrangement of elements in your example made me think that a table might be a workable solution. The answer I arrived at is "Yes, it's a solution, but it takes a while to set up." If it's reusable easily, then it might be worthwhile investing in a few experiments.
    I've attached a zipped idml interchange version of the file, and also a PDF.
    Here are some notes:
    * I created a table with three rows and three columns, no header or footer rows. Three columns because I thought I'd paste a vertical line into an inline anchored frame in the center cell of the top row, for the separator line. Later, I realized that defining the vertical cell rule as paper color would suffice, so I merged the two right cells on the top row to create a two-column row, with text in each cell and the vertical separator between them.
    * I merged all three cells on the second row into a single cell.
    * I merged the two right cells on the bottom row, but later, when I moved the cell rule to position the triangular graphic in the inline anchored frame in the right cell, it moved the vertical cell rule in the first row. So, I had to unmerge (or split) the cells, and cut/paste the triangular graphic's anchored frame into the rightmost cell. To position the anchored frame, I moved the vertical cell rule with Shift+Drag, to keep the table width unchanged.
    * I sampled the purple color with the eyedropper tool while cells were selected and the swatch panel was set to fill the selected object.
    * I didn't spend much time matching the type, as you can see. To position the text, I adjusted the cell margins in some cases, and left/right indention in some cases; I'm not sure which is more efficient in situations where there will be different amounts of text to fit. I didn't create cell styles or paragraph styles (BAH! Bad, bad, bad process) because I won't be repeating this stuff, but you probably will benefit greatly from defining styles for your repeating needs.
    * The triangular cut into the bottom row made it easy to manage creating and positioning the graphic. A non-geometrical object might be trickier. The triangle is a text frame, set to negative space above, so it overlaps the cell above it, enough to avoid a black gap.
    * Except for the vertical paper-colored divider line, all the cells have zero-width strokes.
    * I created the table in a text frame, that I fitted down to the size of the table, but I can't remember if I selected, copied, and pasted the text frame into the text flow to anchor it, or if I selected the table in the text frame, copied and pasted it into the flow. Not sure if it makes a difference in work efficiency.
    If I understand your general needs, this should work well for changing text and adjusting the column widths.
    HTH
    Regards,
    Peter Gold
    KnowHow ProServices

  • Active mode multiple selection in dialog screen

    in my dialog screen i had multiple selection option button by using the below function module.
    CALL FUNCTION 'K_CMPERS_MULTIPLE_SELECTION'
      EXPORTING
        P_FIELDTYPE         = 'R'
        P_FIELDNAME         = 'MATNR'
        P_TABLENAME         = 'MARA'
      TABLES
        PT_PARM             = HMAT.
    its working fine.
    but when i enter data into multiple selection it does not changes to active mode ( green color).
    can u pls tell me how to change it into active mode when data is there

    Hi Banu,
    The icon will not change automatically. You need to write code in PBO and change the icon of your push button accordingly.
    Please refer to the document below for how to change icon of push button in module pool:
    [http://wiki.sdn.sap.com/wiki/display/sandbox/ChangeanIconofaButtonDynamicallyInModulePool|http://wiki.sdn.sap.com/wiki/display/sandbox/ChangeanIconofaButtonDynamicallyInModulePool]
    Cheers,

  • Spliting deliverables according to multiple selection and load it

    Hi ,
    There are some couple of Deliveries and I need to split them into multiple selections .Then I need to  load them based on selections to ods and cube .
    Please tell the steps to do this in BI7 Verison.

    you can create two transformation groups to splitt data. maintain rules for both groups
    or
    start routine can be used to split the data
    loop at source_package into <source_package>.
    If <check if this record should be splitted>
    wa_newdata = <source_package>.
    Modily your new line accoridingly..
    append wa_new_data to it_new_data .
    endif.
    clear wa_new_data
    endloop.
    append lines of wa_new_data to source_package.

  • InDesign CS3 Scripting XML Import Multiple Images into same Text Frame

    I am having trouble importing multiple images into the same Text Frame using XML import. I imported 5 images into the text frame. However, all 5 images are laying on top of one another. Does anyone know if there is a way to have all images laying out like how Microsoft Word handles inline images, i.e., laying out next image to the right of previsous image in the same line and if there is not enough space left in the line, then wrap to next line. Thanks in advance. I understand I could use JavaScript to do post import processing, e.g, calculate the image size and place each images accordingly. But I am trying to see whether there is a way to do this without scripts.

    You can apply an object style to all anchored images by script. A text frame containing main flow should be selected.
    var doc = app.activeDocument;
    var textFrame =  app.selection[0];
    var rectangles = textFrame.texts[0].rectangles;
    if (rectangles.length > 0) {
         for (var i=0; i < rectangles.length; i++) {
              rectangles[i].appliedObjectStyle = doc.objectStyles.item("Cover");
    However, there is a better approach:
    Step 1
    Create place holders for a single "Book" element and format it as needed -- apply an object style to the cover.
    Step 2
    Import the xml file -- the placeholders are replaced with data from the 1st xml element
    Step 3
    Drag & drop the element containing all "Books" elements into the main flow -- all elements are placed and formatted the same way as in step 1.
    Finally, add a new page, click the overset text icon and autoflow text to add pages so that to fit all the text.
    Hope this helps.
    Kasyan

  • Insert data into multiple entities at once using a view object

    Hi,
    I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
    Is this possible? And how (if it is)?

    Hi,
    I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
    Is this possible? And how (if it is)? Peter:
    This is definitely supported and tested. Please send us the exception stack trace. You must running into other problems. A few things to note:
    A) You have to mark the entities as both updateable (not read-only) and not reference-only.
    B) If you're not seeing an exception stack, turn on diagnostic. Here is how:
    To turn on diagnostic, go to the IDE,
    1. Select the project.
    2. Do right mouse click and select "Project Settings..."
    3. On the Settings dialog, select Configurations/Runner.
    4. In the righthand side pane, you should see a textbox for "Java
    Options". Please add the following JVM switch:
    -Djbo.debugoutput=console
    Then, rerun. The run command should include
    -Djbo.debugoutput=console as in
    "D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
    You should now see a lot more output on the IDE's message window. Here you should see the exception stack trace.
    If you invoking your app directly from command prompt, just add "-Djbo.debugoutput=console" after your "java.exe".
    Thanks.
    Sung

  • Querying for a script insert multiple selected objects...

    Is there a script or plugin which insert multiple selected objects in one new text frame with one click?
    And is there a script or plugin which extract the content of anchored text frame out it's frame and replace it with it's frame. and extract selected text and insert it inside a new anchored text frame in it's place? (like convert text to table - convert table to text, but instead table we use text frame)

    Hi,
    Using OMB scripting to set attribute properties in a data mapping sort of defeats the purpose of utilizing a graphical user interface to define and set properties for a data mapping? Surely the GUI data mapping tool was created to get away from writing scripts and scripting would also require that you know the name of the data mapping, table operator and the set of attribute names for which you have to write one line of script to set each property value, i.e. 90 lines to set 90 attribute values.
    Cheers,
    Phil

  • How do I import or move multiple selected photos to an existing album in iPhoto 9.6? In previous versions I could select and drag multiple photos into an album. Now I can only move one photo at a time. Help!

    How do I import or move multiple selected photos to an existing album in iPhoto 9.6? In previous versions I could select and drag multiple photos into an album. Now I can only move one photo at a time. Help!

    Try this general troubleshooting procedure:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete the contents the following folder: User/Library/Containers/com.apple.iPhoto
    3 - reboot, launch iPhoto and try again.
    NOTE: For Mavericks and Yosemite,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    where you can check the Show Library Folder checkbox.

  • How can I export multiple selections in a list box into a .csv file?

    Hi all, I've created a form in Acrobat X with a list box enabled for multiple selections. When I try to export the filled out form into a .csv file, only the first selection shows up. Can anyone help me figure out how to get all selections to export? Thanks!

    Thank you for your quick response!
    Once a recipient fills out the form (which has two questions with list boxes and multiple selection enabled) they send the completed form back to me. When I open the completed form, I am given the option add the completed form to a reponse file which was set up when I distributed the form. When I open the reponse file, it lists all of the responses in rows, and the values that were chosen in the form are arranged in columns. In this file, the list boxe columns have multiple values, separated by commas (which is what I'm looking for). At this point there is an option to export into a .csv file or an .xml file. If I choose the .csv file and open in excel, only the first selection shows in the list box column rather than all selections that were initially made by the responder.

  • List/Menu (multiple selected)  insert into MySQL

    I have been building a feedback form and I am running into a
    issue that when I place a list/menu that allows multiple selections
    when I submit my form in my MySQL database it collected the
    information but only on the last multiple selection.
    For example, this is what my list/menu looks like.
    <select name="occasion" size="5" multiple="MULTIPLE"
    id="occasion">
    <option value="Spur of the moment,">Spur of the
    moment</option>
    <option value="Family dinner">Family
    dinner</option>
    <option value="Special occasion (i.e.
    birthday)">Special occasion (i.e. birthday)</option>
    <option value="Office get together">Office get
    together</option>
    <option value="Romantic dinner">Romantic
    dinner</option>
    <option value="Night out with friends">Night out with
    friends</option>
    <option value="Business meeting">Business
    meeting</option>
    <option value="Other">Other</option>
    </select>
    And my MySQL database I have it set up as...
    Field Type
    occasion mediumtext
    I do not know why I cannot have more than one selection
    inputed into my field, what must I do to correct this? Everything
    works perfectly expect the multi selected list/menu. I want to
    place all that is selected in the list/menu in that one database
    field called occasion.

    .oO(MikeL7)
    >>You should also test with isset() and is_array() if
    $_POST['occasion']
    >>is available at all and of the expected type. The
    code above will also
    >>throw a notice if $insert_string is not initialized
    before the loop.
    >
    > I use both isset and is_array in my code, When you say
    notice, you dont mean
    >a script stoppiong error?
    Nope. An E_NOTICE error won't terminate the script, but
    shouldn't happen
    nevertheless. While developing, the error_reporting directive
    should be
    set to E_ALL|E_STRICT and _all_ reported problems should be
    solved. It's
    not only better coding style, but also helps to prevent real
    errors. In
    this particular case it was just a guess, because it was only
    a part of
    the code. But using an uninitialized variable with a '.='
    operator for
    example would lead to a notice, which should be fixed.
    >>But of course this is a really bad DB design, as it
    already violates the
    >> first normal form (1NF). Just some ideas for queries
    that might come to
    >> mind, but would be really hard to do with such a
    comma-separated list:
    >
    > A better table design would be to have column for |
    list_ID | user_ID |
    >song_ID | and do a insert for each song selected.
    Yes, something like that.
    >Thanks for the input, i like escaping the variables from
    a string as they
    >stand out more in code view, is the single quote method
    faster? And which one
    >will be or is already deprecated?
    All are correct and won't be deprecated. IMHO it's more or
    less just
    personal preference. It also depends on the used editor and
    its syntax
    highlighting capabilities. For example I use Eclipse/PDT for
    all my PHP
    scripts, which can also highlight variables inside a string.
    But if the
    above is your preferred way, there's nothing really wrong
    with it.
    Just some additional thoughts:
    Personally I prefer as less escaping and concatenating as
    possible,
    because such a mixture of single quotes, double quotes, dots
    and
    sometimes even escaped quote signs (for example when printing
    HTML)
    _really_ confuses me. I like to keep my code clean and
    readable.
    Something like this:
    print "<img src=\"".$someVar."\" ...>\n";
    not only hurts my eye, it is also quite error-prone. It's
    easy to miss a
    quote or a backslash and get a parse error back, especially
    in editors
    with limited syntax highlighting (or none at all). So I would
    prefer
    print "<img src='$someVar' ...>\n";
    or even
    printf("<img src='%s' ...>\n", $someVar);
    When it comes to performance issues, of course there's a
    difference
    between the various methods. But for me they don't really
    matter. In
    practice you usually won't notice any difference between an
    echo, a
    print or a printf() call for example, as long as you don't
    call them
    a million times in a loop.
    So I always just use the method that leads to the most
    readable code.
    In many cases, especially when a lot of variables or
    expressions are
    involved, (s)printf() wins. Not for performance, but for
    readability.
    But as said - personal preference. YMMV.
    Micha

  • Multiple selected text frame to table

    I am looking for a script that will allow me to select multiple text frames at one time and have the contents in those text frames converted to tables.
    What I have to do now is place the cursor in one text frame, select all, select menu item "convert to table", the defalt dialog appears and I click ok.
    I have ten text frames on a page (for example). The manual process means I have to do the text to table 10 times per page.
    So, I would like a script that will allow me to select all 10 text frames and convert the content of each frame to a table.
    Any suggestions are appreciated.
    RPP

    This should do it:
    if (app.documents.length > 0 && app.selection.length > 0)
      for (i = 0; i < app.selection.length; i++)
        try {app.selection[i].texts[0].convertToTable ("\t", "\r")}
          catch (_) {}
    Peter

  • Is it possible to select an anchored object in a text frame in InDesign in a script?

    I would like to know if it is possible to write a script to select an anchored object in a text frame. All the scripts I have found so far do not work on anchored object.

    Check out this thread.

  • OLM - Merging Multiple Learning Objects into One

    Does anyone have experience or success merging multiple OLM learning objects into one? I think that we are supposed to be able to do this by exporting a content folder that contains all the learning objects that we want to merge into one CBT. The export works for me, and the learning object plays, but the content is not complete or combined. I noticed that the new content contains files called metadata(0).xml and metadata(1).xml representing the two learning objects that I tried to merge into one. I wonder if there's something I'm supposed to do with these files. Has anyone been successful in merging content?

    Content can be combined into a course structure like:
    Course Learning Object
    -- Topic 1 learning object
    -- Topic 2 learning object
    By creating a parent "course" learning object and moving the individual objects underneath it. The offering is then tied to that course learning object, so that when a user enrolls, in order to complete it the user navigates through both objects.
    You cannot combine all the pages from separate objects into a single learning object as the pages themselves have no knowledge of each other.
    Does that make sense?
    Scott
    http://www.seertechsolutions.com

Maybe you are looking for