[CS3 / VBS] Groups in CS3

I've converted over a few scripts that used to work fine in both CS and CS2.
One particular scripts extracts text from tables on multiple textframes that include tables. After changing over to CS3 with this script, it does not extract any of the text from textframes/tables that has been grouped with other objects (for example images and other text frames).
My question is there a way I can have the script ungroup items prior to running the rest of the script or is there any easier way than rewriting the whole script to include groups?
Thanks!

You don't need to ungroup the groups: use AllPageItems property of Group object. See posts 3 and 4 here – http://www.adobeforums.com/webx?128@@.59b6848b
Kasyan

Similar Messages

  • [AS CS3] Bug? All Page Items - grouped items w labels

    Can anyone confirm this behaviour for me. I would classify it as a bug, but maybe the logic for it not being a bug escapes me.
    The command "all page items" is supposed to return a (flat) list of every page object, right? I would suspect that I should be able to address any object in the list. But I can only seem to address an object when it's inside of a group.
    I am trying to get the text of a text frame that has a label. It may or may not be inside a group. I can certainly do a try/error block to try a script statement for objects in a group or not in a group. But I think that "all page items" should be able to handle it directly.
    Here's a test script: ------
    tell application "Adobe InDesign CS3"
    tell document 1
    get label of all page items
    set myUngrouped to contents of text frame "some label" --only works when objects ungrouped, this is expected
    set myText to (get contents of text frame "some label" of all page items)
    --both statements work ONLY when objects grouped
    set myText to (get contents of every page item of all page items whose label is "some label")
    end tell
    end tell
    Steps:
    Make a new document.
    Draw a text frame. Type some text into it.
    Label the frame "some label".
    Draw another empty graphic or text frame.
    Run script
    -->result is, myText statements error out. Why is this?
    Now group all items on page.
    Run script.
    -->result is, myUngrouped can't continue. This is expected.
    Comment out myUngrouped statement
    Run script.
    -->result is, myText statements work OK.

    On 19/8/08 1:14 AM, "SuperMacGuy" <[email protected]> wrote:<br /><br />> set myText to (get contents of every page item of all page items whose label<br />> is "some label") <br /><br />The syntax is a bit tricky. The key is that all page items returns a list,<br />so what you want is certain items -- not page items -- from that list. So:<br /><br />set myText to (every item of all page items whose label is "some label")<br /><br /><br />-- <br />Shane Stanley <[email protected]>

  • CS3: Make mask using group with strokes, fills, multiple objects,etc

    I am currently using CS3, and I have created 2 objects with gradient clipping masks on them, to go over a group (my logo). I am hoping to create a glass effect with these gradients over my logo.
    The problem I am running into is that I cannot use my logo as a group to mask the gradient objects. I have attempted joining, combining, etc my logo group and making it a mask, but there are strokes inside that then mask as the fill shape.
    Is there a way to mask, not unlike the clipping mask tool that is so easily used in Photoshop CS3?

    Is this any help?
    To clarify this is what I want to achieve:
    So that all the grey area is transparent.

  • Cs3 grouping clips for slow motion.

    hi im editing multiple clips of video and the song that im using is 10 seconds to long. my idea to solve this is to slow the clips down to around 90ish% speed so it increases there time so they are the exact length of the song. I thouhgt I would be able to highlight all the clips then right click and chose group then use the time stretch tool to stretch the group as a whole but this does not work. I would like to know if there is any way to do this. the only work around i have found is export the clips so they become one then import them back in and edit them that way of play around with each clip individually. im new to cs3 so please bear with me and this might be very simple and I could just be missing it so any help is appreciated.

    Nesting sequences:
    Copy/paste your clips that need to slow down in a new sequence.
    Nou bring this sequence into your main timeline and use the strecht tool to slow it down.

  • Resizing objects and groups in CS4 - different from CS3

    Hi all,
    In CS3 I used to be able to resize objects or groups of objects by just using the solid select tool and just grabbing a corner or side of the object and resizing it.  That doesn't work in CS4.  Doing the same thing only moves the image around.  I have to actually use the scale pop-up.
    I can still do the same thing an anchor or path at a time with the outline select tool.
    I'm sure there's a way to do this in CS4 and there's probably a switch buried deep in some menu to allow this, but darned if I can figure it out.

    I'm still on CS3 so I don't know for sure, but I don't think so.  It's always been a pretty easy key shortcut to hit by accident though. 

  • CS3 Can't select or fill area in live paint group

    Hi, I have Illustrator CS3 on Windows Vista Home Premium. I made a live paint group and colored in the various areas. I was doing more work and noticed that some areas lost their color. I can't select them now as a live group to color.
    The outlines can be selected, but not the fills. Also there are a few places where the fill spills out to adjacent area. The gap detection doesn't seem to do anything. Can anyone tell me what I am doing wrong? I also just downloaded the newest driver for my wacom intuos 2 and it is doing some odd things. Could that have anything to do with it?
    Thanks for the help. :)

    I'm away from my Photoshop system right now, so I'm sorry for any inaccuracy, but if you select the eye dropper tool in the Tools panel, then look near the top of the Photoshop main window in the options area, do you see a "Sample" selector?  Alternate settings of this selector will probably get you the behavior you want.
    -Noel

  • Best way to color multiple groups in CS3

    I provide resources for other designers to purchase to help them create certain old print style effects. The problem with this is that I need to make sure that it works in older versions of Photoshop. The problem I'm having with CS3 and CS4 is coloring groups without the ability of masking a group with a solid color. I've tried Gradient Map which works if placed inside a folder, but this doesn't work over 2 groups like in the image below. Is there a better way of easily changing the color of group(s) in older versions of PS?
    Thanks Ian

    I provide resources for other designers to purchase to help them create certain old print style effects. The problem with this is that I need to make sure that it works in older versions of Photoshop. The problem I'm having with CS3 and CS4 is coloring groups without the ability of masking a group with a solid color. I've tried Gradient Map which works if placed inside a folder, but this doesn't work over 2 groups like in the image below. Is there a better way of easily changing the color of group(s) in older versions of PS?
    Thanks Ian

  • [CS3 / VBS]  Search in CS3

    I have another old script I'm updating for CS3. This one uses the "Search" function and CS3 doesn't like it, what would be my best option to replace this line with since I'm not having very good luck with it?
    If TextFrame.Tables.Item(1).Cells.Item(CellCounter).Characters.Count > 0 Then
    TextFrame.Tables.Item(1).Cells.Item(CellCounter).Search vbCr, False, False, " "
    End If
    Thanks in advance!

    Hi bstimpson,
    Try something like this:
    Rem Given a reference to InDesign "myInDesign"...
    Rem Clear the find text preferences
    myInDesign.FindTextPreferences = idNothingEnum.idNothing
    Rem Clear the change text preferences
    myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
    Rem Set the "find what" property to a return
    Rem (using the InDesign metacharacter).
    myInDesign.FindTextPreferences.FindWhat = "^p"
    Rem Set the "change to" property to a space.
    myInDesign.ChangeTextPreferences.ChangeTo = " "
    Rem Do the find/change operation.
    TextFrame.Tables.Item(1).Cells.Item(CellCounter).ChangeText
    Rem Reset the find/change preferences
    myInDesign.FindTextPreferences = idNothingEnum.idNothing
    myInDesign.ChangeTextPreferences = idNothingEnum.idNothing
    Thanks,
    Ole

  • Table Format VBS CS3

    I have a pre existing script that we used in CS and CS2 to reformat a pre-existing table.
    I won't include all the VBScript but what it basically does is this -
    -Take an existing frame that already has a table.
    -Then the borders are changed and the text is aligned.
    -Then a dialog box appears and you can then select colors for different cells, etc.
    -After doing that the colors are filled into the different cells.
    The script has worked in both CS and CS2 perfectly (other than making few minor changes like setting the Application to CS, CS2).
    After trying it in CS3 instead of reformatting the table it strips the borders completely and then adds a table above the existing table/text.
    My question is if anyone knows of any major changes in CS3 for Table Formatting?

    I have walked through the VBScript and it appears that the line that doesn't seem to work the same is this -
    Set myTable = myStory.Tables.Add
    This doesn't reformat the text into a table but instead adds a table above the text.
    Any ideas would be great!

  • TextFrame Object CS3 [vbs]

    Good Morning all, I'm trying to access the Textframe object in CS3. I've noticed that there is a "Textframes" object which seems straight forward to access and there is plenty of documentation on the next and in Scripting Guides.
    However I cannot find any examples, tutorials or guides in how to access the "Textframe" object.
    can anyone help please?

    hi
    Set myTF = myStory.TextFrames.Item(1)
    gives you first TF of Story
    Set myTF = myDoc.TextFrames.Item(1)
    gives you first TF in Document
    Set myTF = myChar.ParentTextFrames.Item(1)
    gives you parent TF of character - works same way for all text objects - Line, Word, Paragraph, Text, TextColumn, InsertionPoint - even if your text is in Cell - doesn't work in ID 2.0.2
    Set myStory = myTF.ParentStory
    if you want to get parent Story
    robin
    www.adobescripts.co.uk

  • [CS3 / VBS]  TextFrame Problem

    So one of the old scripts I have revised to work for InDesign CS3 has a small problem.
    The script basically converts text into a table w/ some coloring options and so on. The problem is if I run the script with parts of the textframe not showing then it will only format the visible text. If I expand it and show the whole frame then it will work.
    Is there a quick option that I can throw in the code that will include all contents of the textframe so they are all converted correctly without expanding the frame?
    Thanks in advance!!!

    I don't know if I know exactly how the "parent story" works. I've been thrown into the scripting and InDesign world just recently and I'm working with scripts that were previously built.
    Here is a part of the VBScript that decides the users selection, maybe someone can help in telling me how to add the story into this -
    Rem finds the applicable frame and sends it to the ConvertIt function
    Set mySelection = myDoc.Selection.Item(1)
    Select Case TypeName(mySelection)
    Case "TextFrame"
    If mySelection.StartTextFrame.Tables.Count = 1 Then
    mySelection.StartTextFrame.Tables.Item(1).ConvertToText
    End If
    ConvertIt (mySelection.StartTextFrame)'.Texts.Item(1).ParentTextFrames)
    Case "Text", "InsertionPoint"
    If mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Count = 1 Then
    mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Item(1).Text.Item(1).ConvertToT ext
    End If
    ConvertIt (mySelection.ParentTextFrames.Item(1).StartTextFrame.Tables.Item(1).Texts)
    Case "Cell"
    Set mySelection = mySelection.Parent.ConvertToText
    ConvertIt (mySelection.ParentTextFrames.Item(1))
    Case Else
    MsgBox "Invalid Selection"
    End Select
    End If
    I appreciate all the help!!!

  • CS3 JS Add group into frame

    Hi
    In InDesign UI you can copy a group of frames and paste it into another frame.
    I'm trying to replicate the results via JS
    I tried this:
    x = app.activeDocument.rectangles.add();
    y = app.activeDocument.ovals.add();
    z = app.activeDocument.ovals.add();
    x.groups.add([y,z]);
    then this:
    x = app.activeDocument.rectangles.add();
    x.groups.add([app.activeDocument.ovals.add(),app.activeDocument.ovals.add()]);
    Both attempts ended up with "Invalid parameter" error message
    Then I tried this:
    x = app.activeDocument.rectangles.add();
    y = app.activeDocument.ovals.add();
    z = app.activeDocument.ovals.add();
    g = app.activeDocument.groups.add([y,z]);
    g.select();
    app.cut();
    x.select();
    app.pasteInto();
    It did the job without errors, but I'm affraid it will be unnecessary slow in real world deployment.
    Please, can anyone explain what I did wrong with my first two attempts?
    Thanks for help
    Weller

    Hi
    Having carried out more experiments I made this discovery:
    (assuming that "myObject is a rectangle")
    after running:
    myObject.rectangles.add();
    myObject.rectangles.add();
    myObject.rectangles.add();
    I ended up with a couple of rectangles inside of the "myObject" frame.
    But they were not grouped.
    Though this partly solves my problem, I'm aware that Indesign won't allow me to do this in UI. (That is, it's only a single object or a group that can be "pasted into"). Am I really in for a big problem if I use this method?

  • [JS InDesign CS3] Style groups, begone! (or: How do I take paragraph and character styles out of style groups?)

    Sorry for this question (and my terrible English, by the way), I'm a javascript noob and I know when I've reached my limits.
    Well, I'm trying to take a set of paragraph and character styles out of the style groups they are placed in, in hundreds of InDesign documents (that cannot be treated as a book). As far as I've tried (thanks to the invaluable help of previous posts in this forum) I've been able to move a style into a group and change it's position inside the group, inside the root level or even between groups. But it doesn't matter how I try, I don't know which move reference should I try in case I want to take every style out of their style group and place them after their original group folder, at the [Root] style level .
    I have tried:
    var doc=app.activeDocument;
    var pGroups=doc.paragraphStyleGroups;
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Here I am, trying to move a style outside the folder that contains it, and failing miserably.
              pStylesInGroup[j].move (LocationOptions.after, pGroups[i]);
    It didn't work, the script sent an invalid parameter value in the reference field, so I cant use the group folder itself as reference.
    Tried other (obviously wrong) solutions, like use the first available style as reference. Therefore, my second script was
    var doc=app.activeDocument;
    var pStyles=doc.allParagraphStyles;
    var pGroups=doc.paragraphStyleGroups;
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Now I try placing the styles after the [Basic Paragraph], that is, the second paragraph style in the document style list
              pStylesInGroup[j].move (LocationOptions.after, pStyles[1]);
    It didn't work either, another invalid parameter in the reference field. Similar results with my other attempts (I even tried "[Root]" as literal with similar luck).
    So, my question is: Which command (or script, in case my whole approach is utterly wrong) should I use to achieve my goal?
    Thanks in advance to whoever decides to spend more than a minute thinking about my humble worries, and my apologies for shamelessly ripping some of your lines of code for my purposes.

    Okay, tried a few things and got really weird results!
    1. You can move a style around inside its group.
    2. You can move a style out of a group "to" another, but it will appear 'inside' that style. I got my test style as a sub-item of [Basic Paragraph], using index #1. With index #0 ([No Paragraph Style]) InDesign crashed.
    3. You can duplicate the style, but then you get a copy in the same group. Still no luck.
    4. Finally! What is the parent of a paragraph style?
    Document | Application | ParagraphStyleGroup
    "Application" is easy -- that's when you make a style global. So what's the difference between 'Document' and 'paragraphStyleGroup'? Simple -- well, when you finally get it...
    pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    moves the style out of the group and to the end of the list in the document. I don't think it's possible to move it directly to a specific position into the main style list -- you first have to move it out of a group, then move it around in its own list.
    Fortunately, it returns its new position as a ParagraphStyle again, so if needed, you can use
    newStyle = pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    newStyle.move (LocationOptions.AFTER, pStyles[1]);
    -- I didn't really try that out, but it should work.

  • JS CS3 Fastest way to create a group

    I have a selection of about 1050 elements and to create a group I'm using:
    var myNewGroup = new Array;
    for (i=app.selection.length-1; i>=0; i--) {
        myNewGroup.push (app.selection[i]);
      var myGroup = app.activeDocument.groups.add(myNewGroup);
    This works but it's very slow. I have tried the following:
    var myNewGroup = app.selection;
    var myGroup = app.activeDocument.groups.add(myNewGroup);
    The app.selection approach gives me an Invalid parameter error. What I don't understand is that the working code creates an array and adds each element to the array then a group is created from that array.
    With the second approach app.selection is an array so why does this group?

    Thanks again Kris,
    The document I'm trying this on is supplied not created by me so I should of run a test on a doc a created first, so I did. I made a new A4 doc and place a number of text elements on the page then selected them and ran the script again. Sure enough the selection became a group.
    So I went back to the supplied doc and selected a couple of the frame and check under the Object menu , Content and to my surprise the options Graphic, Text, and Unassigned were all grayed out (could not select any).
    Yet when I ran:
    $.write(app.selection[1].constructor.name+"\n");
    the console returns TextFrame and for
    $.write(app.selection[1].contentType+"\n");
    the console returns 1952412773 (TEXT_TYPE).
    So there seems to be an issue with the file not the script. Thanks for you help Kris much appreciated.

  • [JS] CS3 Help with groups needed

    Hi.
    I am formatting a page of text frames, and images, and trying to group the selected objects together.
    While formatting the pageI am gathering an array of variables:
    myGroupArray = new Array();
    myGroupCounter = 0;
    myGroupArray[myGroupCounter]="myTextFrame";
    myGroupCounter++;
    etc...
    when I am finished a section, I want to group the contents of the vaiable 'myGroupArray'
    I am using this line:
    myGroup = myDoc.groups.add(myGroupArray);
    but getting an error 'Invalid value for parameter 'groupitems' of event 'add'. Expected Array o...t received("myTextFrame","myCorrectPic","myPriceFrame","mtQtyFrame").
    Can someone help me on this?
    Cheers
    Roy

    (Without actually trying it in ID)
    myGroupArray[myGroupCounter]="myTextFrame";
    That adds a string to the array, not the frame. If "myTextFrame" is a variable pointing to a text frame, simply use
    myGroupArray[myGroupCounter]=myTextFrame;
    By the way, have you been programming in other languages in the past? I have, and used
    myGroupCounter++;
    as well until finding out that for arrays, this built-in array function works equally well:
    myGroupArray.push(myTextFrame);
    Types much faster, and if you need the number of elements, you can always use myGroupArray.length.

Maybe you are looking for

  • No longer can edit Javascripts after upgrade to 3.0.9.8.4

    We can no longer edit any Javascripts in the Shared Components application since upgrading to 3.0.9.8.4. This has happened on 2 separate installations. When we click "Edit" next to the Javascript name, we are served a blank page. It works fine on 3.0

  • Final Cut Pro 7 not recognizing Sony HDV Deck on older 2008 version MacPro's

    I am trying to connect a Sony HDV deck to Final Cut Pro version 7 on an older 2008 version MacPro.  The problem was with the firewire mini port on the back i believe because i used a different deck which was the same model - but the only difference w

  • Music not playing in itunes 8.02, seems like a constant pauze/freeze

    Hey, so lately I've been having he problem that my itunes has stopped playing music. I'd select a song and click play and nothing happens, and browsing to a different point in the song doesn't help - it never plays and the song seems frozen. Youtube

  • Steps to create a materialized views

    Hi we have a table in production database and i wanted to build a snap shot of that table in 4 different database that are on 4 different servers. Can any one give me a good document summarizing steps to built a materialized views. Also have a few qu

  • Reports with COPIES 1

    HI Gentlemen, I have to run my report twice, once with 'Original' and once with 'Copy' in the top margin. It works fine if I execute it twice, supplying a text parameter from outside. However, this generates two PDF files. This is undesirable--they s