Script - Paste a Group into a TextFrame

Very similar to my last question here - http://forums.adobe.com/message/4167532
In Indesign desktop I can copy and paste a group inside a text frame - obviously this can't be done in Indesign server.
I have tried looking at the duplicate and move methods - but these don't take a page item as the 'to' parameter.
var textFrame = myPage.pageItems.item("TextFrame");
var group1 = myPage.pageItems.item("group1");
var group2 = myPage.pageItems.item("group1");
I can remove items once they are already in the text frame with
textFrame.pageItems.item(0).remove();
PageItems is read only - so I can't add items to it.
Suggestions?

Alas -- the following did not work, although it does with another kind of item (try with "rectangles.add", that works). It may give you some fresh ideas, so I'm showing it anyway:
textFrame = app.selection[0].parentTextFrames[0];
group1 = app.layoutWindows[0].activePage.parent.groups[0];
group1elements = group1.ungroup();
textFrame.insertionPoints[1].groups.add(group1elements); <-- fail!
You can test this in the UI version with (1) some group, and (2) a text frame with the text cursor inside it.
The "fail" line errors out with
JavaScript Error!
Error Number: 24
Error String: textFrame.insertionPoints[1].groups.add is not a function
File: zzztry.js
Line: 5
Source: textFrame.insertionPoints[1].groups.add(group1elements);
which is kind of a bummer.

Similar Messages

  • How to paste a group into a shape so that contents warps accordingly?

    Hi. I need help accomplishing something which I assume is pretty basic in Illustrator, but I can't seem to find any tutorial on the web on how to do it.
    I made a tall and narrow rectangular shape. Lets just say 40 pixels wide by 800 pixels high. I gave it no stroke, but gave it a red fill. I copied this rectangle six times and aligned them all adjacent to one another, side by side. I gave each of the other six tall and narrow rectangles different fill colors: orange, yellow, green, blue and purple. Then I grouped all seven rectangles together resulting in a rainbow colored rectangle 280 pixels wide and 800 pixels high.
    On a separate layer I used the pen tool to create a wavy-like shape, curving, zigging and zagging so that the shape is of varying widths and extends to 800 pixels high from top to bottom. I guess the shape resembles a long winding water-slide at a water theme park, or possibly a winding pillar of smoke coming out of a chimney. I hope you get the picture.
    Now, what I want to do is to take that rainbow colored group and somehow insert it into that wavy winding shape. By this I don't mean like a clipping mask, but rather I'm expecting the group of rainbow-colored rectangles to warp and distort itself in reference to the curves and varying widths of the wavy shape in which it is nested.
    I hope this is clear.
    Thanks for any help

    What you need is an envelope , but most probably it won't work when you just use the wavy form as an envelope. Illustrator plays by its own rules. There are some threads that discuss problems like this. Envelope will be a good term to search for.
    Normally you'll have to first create a simple rectangle mesh, form that in that wavy  kind of fashion and then use it as an envelope. But some other methods were discussed here already.
    You should read on envelopes in the manual first.

  • Script - Paste a TextFrame into a TextFrame

    Hi,
    I am very new to Indesign Scripting (1 week?).  Getting stuck trying to Paste a TextFrame inside another TextFrame.  I can do it in the UI and successfully wrote a script to do this:
    app.select(someTextFrame);
    app.copy();
    app.select(pasteIntoTextFrame.insertionPoints[0]);
    app.paste();
    Where someTextFrame is the TextFrame I am trying to copy into the PasteIntoTextFrame....
    But, this doesn't work on InDesign Server.
    Example / Reason: TextFrame1 willl be centered, Then TextFrame2 will be aligned right, TextFrame3 centered, TextFrame4 aligned right. 
    Then all of these are pasted into the 'Master' text frame with its own alignment options
    Hopefully the diagram will help explain my poor description.
    Can anyone point me in the right direction? Thanks

    Hah -- that was quite difficult to pull off. You are correct in your observation that IDCS Server cannot use 'select', 'copy', and all other UI based commands, so you have to do it purely by manipulating the objects.
    Unfortunately, all objects do have a 'move' method but ... it only can accept some page position and not an insertion point, which is what you need here. So there is no way to physically move an existing text frame into text (or, for that matter, a button, or a rectangle, line, ellipse or anything else).
    But you can create a new object in-line:
    mynewTextFrame = app.activeDocument.stories[0].insertionPoints[3].textFrames.add();
    will create a new text frame between characters numbered 3 and 4 -- between the two letters "l" if the first word in the first story is "hello there!". Then you can move your existing text out of "someTextFrame" into the newly created frame, and copy as much other parameters as you need to it. Finally, you can delete the original frame (or perhaps move it out of the way onto the pasteboard, since you never know what you might need it for).

  • I get this message when trying to past simple text into an e-mail document. The Web-Based Email plugin has crashed. I have run out of options...please help.

    The Web-Based Email plugin has crashed. I get this message when trying to paste simple text into an email document. I have updated plugins and have run out of options. If I use another browser I have no problem. Please advise.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • 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

  • When typing a Contacts group into Mail address, it inserts duplicates

    MacBook Air using Mavericks. I have a Group set up in Contacts. When I type the name of that group into the BCC field in Mail, I get every name in the group at least twice.

    I had similar problems. In Leopard, I used to be able to just drag one or more Groups from the Address Book to the address field in the Mail message, and it would go in unexpanded, as per the Preference I have set in Mail. With Snow Leopard, when I do this all the individual addresses go into the address field PLUS the unexpanded Group.
    However, I found that if I Select the group in Address Book, Copy it, then Paste it into the Mail message address field, all is well. That is, the Group goes into the field unexpanded, and the individuals in the group all receive the message with "To: Undisclosed Recipients" as I intended.

  • Why can't I paste formatted text into Firefox?

    Very simple question. When I try to paste rich text into text field in Firefox (text with hyperlinks added, bolded etc.), Firefox strips all of that out.
    Case in point: I added a link to a piece of text in Evernote for Mac. Copied it. Went to Tumblr, pasted it in... the link is removed. This is retained in Chrome, Opera and Safari.

    # Update The Firefox Version
    # Reset Your Firefox Setting
    https://support.mozilla.org/en-US/kb/reset-preferences-fix-problems
    Note: When using the reset feature,your extensions and themes will be removed; open tabs, windows and tab groups will not be saved; and your preferences will be reset.

  • Cannot paste html content into outgoing messages

    Using Mail 3.2, I am no longer able to "paste as HTML" into an email message. I called AppleCare and spent 30 minutes on the phone with 2 people in the Phillipines but they were never able to understand my problem.
    I am a political activist so do this alot: find something great on the web, copy and paste to an email that I send to a group of people. There should be live links, photos and the original formatting.
    Instead, "paste as HTML" no longer shows up as an option under "Edit." I also tried using the appropriate keystrokes, ie, ^V plus apple key, but only got plain text in my outgoing message.
    Since it still works on my MacMini, for now I am sending messages with HTML on the Mini, but it's a hassle.

    are you using Safari to copy the html stuff? that's the only way Mail will understand it.
    if yes, and it's still not working, try reinstalling the [Safari update|http://www.apple.com/downloads/macosx/apple/application_updates/safari31 .html].

  • CS5: Pasting smart quotes into code view problem

    Hi all,
    In my blogging workflow, I copy the blog text from from MacJournal into the code view in Dreamweaver CS5.  In CS3, it seems that DW allowed the left & right smart and unicode quotes to be pasted in untouched.  However, DW CS5 seems to be converting all single ‘ & ’ to the ASCII ' and all “ & ” to ASCII ".  Is there a way to turn this off?
    I don't want to paste the text into the design view because I don't want DW to auto format the text.  I got some specific formatting that I like to do.
    Thanks!
    Steven

    Yes, the appropriate meta tag is in place.  In Preferences, UTF-8 is selected under Fonts.  Try pasting:
    “Test”
    into the code view and see what happens.  Hmm, Just tried pasting the above into the Design View and the same thing happened.  The curly quotes where changed into straight quotes.  BTW, I'm runn ing DW under Mac OS X Lion.
    I pasted the same text in another app, TextEdit, and the curly quotes pasted just fine.
    I need the curly quotes because I change them into &#8216;, &#8217;, &#8220;, and &#8221; (‘ ’ “ ”) for compatibility with older browsers (pre-IE6).  Yes, my site has been visited by such older browsers.
    Thanks!
    Steven

  • In address book how do I move all cards from my 'last import' smart group into a new group?

    In Address Book, how do I move all cards from my 'last import' smart group into a new group that I will create? So far I am not being allowed to Edit Smart Group!
    Thank you x

    Simon
    You’re going to have a very big problem and very soon. These missing pics are the beginning of trouble.
    the total size of all my folders on my 60gb internal drive is 46.5 gb, yet only 1.9 gb is available,
    OS X needs about 10 gigs of free space on the hard drive for normal OS operations such as virtual memory and temporary files. Without this space the machine slows down as the OS hunts for free space, files become fragmented and applications begin to crash. The risk of data corruption increases exponentially.
    You must, as a matter of urgency, make space on the drive. I cannot stress this enough.
    You may be able to recover the pics from your camera card using an app such as MediaRecover
    Regards
    TD

  • Since switching to Yosemite, I am unable to paste any information into calendar events, instead having to type out all info such as location, notes, etc.  This is true both in daily view and weekly/monthly views as well.  Help?

    Since switching to Yosemite, I am unable to paste any information into calendar events, instead having to type out all info such as location, notes, etc.  This is true both in daily view and weekly/monthly views as well.  Help?

    You welcome

  • How to insert Group into Report Footer or have two Groups in same level

    Hi,
    I am wondering whether it is possible to have two indepent groups---they are at the same level, in one report.
    I tried insert a group into Footer section or just insert two unnested groups in Group Section, but seems undoable.
    Thank you for your help!

    My suggestion will work.  The basic layout would be:
    G1Ha - printed when grouping field = 1  (your "Group header #1" above)
    G1Hb - printed when grouping field = 2  (your "Group Header #2 above)
    Da  - printed when grouping field = 1 (your "AccountNumber1 Account Name1" under group header 1)
    Db - printed when grouping field = 2 (your "Subreport for AccountNumber1 under group header 2)
    G1Fa - printed when grouping field = 1 (your "Group Footer #1 above)
    G1Fb - printed when grouping field = 2 (your "Group Footer #2 above).
    Since the grouping field is the primary grouping, the order that the formats will display is:
    G1Ha
    Da
    Da
    Da
    G1Fa
    G1Hb
    Db
    Db
    Db
    G1Fb
    matching your example perfectly.
    HTH,
    Carl

  • I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?

    I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?  It seems like we were doing these same types of things with Palm Pilots years ago, one would think this would work with iPads?

    I don't believe it will open a Word document, but Writepad allows for handwritten conversion of notes to text and then to email. Might help you some of the way...

  • Cannot copy and paste from Word into Mail

    I cannot copy and paste from Word into Mail. Neither from using the keyboard shortcuts, or using the Menu function. I can copy and paste from other applications into Mail- but for some reason, text copied from a Word document (both in .txt and .doc formats) will not paste into an open email. Anyone else have this issue? It's a new issue. I used to be able to do this easily.

    I had similar issues starting about the same time or within the past week. However, I can copy and paste, it just takes considerably longer than it used to before. Copying something from a web page into Word could take up to 30 seconds now on my computer but it shows a busy mouse pointer while it is loading, then clicks/pops when it loads into the Word document, but then actually takes about another 5 to 10 seconds to appear in the Word document. I have no idea why it is delaying now when it did not do it before, but since it is still going into the document I am living with it for now. Are you waiting long enough to see if it appears?

  • Firefox 6 will not allow you to paste a cookie into the addressbar like all previous versions have. I use software to replace web chat and must do this and have been able to do it in all past versions. What's the deal?

    Firefox 6 will not allow you to paste a cookie into the addressbar like all previous versions have. I use software to replace web chat and must do this and have been able to do it in all past versions. What's the deal?

    Thank you for your response.
    After searching around for any pointers to my problem, the above fixes I listed were the things that came closest to maybe addressing the issue, that I was able to locate. But since none worked, and as you pointed out, it is now clear they will only help towards viewing sent images rather than helping with inserting any images in the body of the email, which is the problem I suddenly started facing today.
    Coming to your suggestion, on opening the Write window, the Insert choice on the menu bar is indeed available. And I had already tried using that, by clicking on the '''Insert ----> Image''' option listed. That opens
    up the "Image Properties" box but using that has not resolved the matter either. It results in an image box getting inserted within the email but without the actual image itself.
    Plus, normally I am able to use the '''Paste''' function in the Edit menu or through right-click, but today the (Cut/Copy/Paste) functions have gone inactive, thereby disallowing me to use that to place an image within the email.

Maybe you are looking for

  • How do i register a new apple id on my iphone?

    I had to diasble my old apple id, so now I need to register my new one in order to download apps, etc. Help!

  • How do I create a Dynamic java.sql.Date ArrayList or Collection?

    I Have a MySQL table with a Datetime field with many values inserted. I want to know which is the Best way to capture all the Inserted DB values inside a Dynamic Array. I get errors that state that I should use Matching data-types, and plus I don't k

  • Lightroom Camera Profile quick question

    Think I know where the problem lies. Pentax K100D recognised in Library metadata but not in Develop ... profile. Can someone please check their (Windows) computer for me?      Program Data/Adobe/CameraRaw/CameraProfiles/Camera I don't have my camera

  • Multiple users multiple computers

    I'm setting up a business right now using macs So far I have 4 different users and 4 computers.  We will end up sharing computers from time to time.  All the services we use are cloud based, email is hosted, website is hosted, pretty much everything

  • Firefox crashes/hangs when clicking on bookmark toolbar links

    Hello. I have had an issue for the last 6-8 months at least, where during daily use, Firefox will crash or frequently hang when clicking on a frequently used bookmark on the bookmarks toolbar. One such bookmark opens a pop up window to enter data and