CS5 - Can't get reference to frame in group

I'm writing a script to place a caption frame (textFrame) back underneath a graphic frame (Rectangle) after one of them has been manually resized or moved on the page. The frames are grouped. To adjust one of them I simply double click the required frame. When finished, I manually select the graphic frame and start the script to reunite both frames.This generates an error when the script gets to the line that sets the geometricBounds for myCaptionFrameY1: object is not valid.
If I manually ungroup the frames, the script works just fine.
I'm confused, because the CS5 Script reference states (page 59) that there is no need to ungroup if you want to change page items in the group (but maybe that doesn't include the textframe).
//left out the myDoc etc.
//this is the manually selected graphic frame, constructor=rectangle
var myImageFrame = app.selection[0];
//the name has been set in another script that generates the graphic and the caption frame
var myImageFrameName = myImageFrame.name;
var myCaptionFrame = myDocument.textFrames.item("cap" + myImageFrameName); //the result (alert) is an object textFrame
//get the bottom of the graphic frame
var myImageFrameY2 = myImageFrame.geometricBounds[2];
//get the top of the caption frame
//this line generates the error: object is not valid
var myCaptionFrameY1 = myCaptionFrame.geometricBounds[0];
//calculate the offset
var myOffset = myCaptionFrameY1 - myImageFrameY2; 
//place the caption at the bottom of the graphic
myCaptionFrame.geometricBounds = [myImageFrameY2, myCaptionFrame.geometricBounds[1], myCaptionFrame.geometricBounds[2]-myOffset, myCaptionFrame.geometricBounds[3]];
Should I reference the caption frame in another way? Or is in this case an ungroup requiered before I move the caption frame? How could that be accomplished?

No, the two frames are the ony elements in the group.
To test your suggestion in a clean environment, I've manually created a new empty document, placed a graphic, drawn a texframe and grouped them. Than I selected the graphic and ran your version of the script. I got the same error on line 4: object is not valid.
What I don't understand is how you get to the textframe without the name property (that comes partially from the selected graphic frame).

Similar Messages

  • Can I get iCal 2 (particularly Calendar groups feature) on OS X 10.3.9 ?

    I'm sure it's a simple question but I can't find anything to say either way...
    Can I get iCal 2 (particularly Calendar groups feature) on my OS X 10.3.9 iBook or do I have to upgrade?
    Since I was first persuaded to get a mac a couple of years ago I've been going on about having groups for my calenders and how simple it must be, since you can group things heirachically in most other apps. So I'm pleased to see it's in iCal 2 however I get the impression that means I have to find the money and the disk space for an upgrade before I can get groups.
    Am I right or is there some wonderful way I can just upgrade iCal?
    Thanks to anyone who can point me in the right direction.
    Jo Coffey
    Catspaw ~ Authentic Entertainment.
    iBook G4   Mac OS X (10.3.9)   iCal current version 1.5.5 v670

    Welcome to Apple Discussions.
    You cannot upgrade to iCal 2 without installing Mac OS X 10.4 at minimum, as critical Mac OS X 10.4 frameworks which it requires, and Address Book 4, which it is designed to exchange data with, are not present in earlier releases of the operating system.

  • Can we get  reference of WD component in custom class of enhanced View cont

    Dear Member,
    We are enhancing WD component. We need to get a reference of WD component in custom class of enhanced View controller (post exit) so that popups can be triggered or URLs can be called?. How should we get reference of WD component? I need to know cons of our approach.
    ...Naddy

    Hi,
    Create one static attribute in your custom class with type ref to of your component and populate this attribute in webdynpro enhancement and then use this reference in your custom class.
    Regards,
    Pon Murugesh

  • Where can I get references about install sap in aix,oracle

    where can I get some references about installation of sap in AIX+ORACLE.      I try to installation sap in AIX, but I encounter many problems,  so I want to have a standard installation reference.     thanks

    Did you look at www.service.sap.com/instguides ?

  • Can't get "Mail" to load a group

    Can't get "Mail" to load a "Contact Group." Group appears normal in "Contact" List. Used to work properly using OSX "Lion." Have had problems since I installed ODSX Maverick.

    Michael:
         Right! I had to prepend a ../ to the url.
    And a [Bindable] to variable, and IT Works!
    And, all this was the Easy part! <G>
    Thanks!

  • How can I get out on a single group message

    I am in a group text message with 10 people and I only have contact information for one of them. I do probably know everyone in the group but as I said I don't have information for pretty much any of them, which makes it super annoying since I have no idea who is saying what. Also with a group of this size, I get bonbarded with like 15+ messages in like a five minute period. I got added to this group two days ago and I have already received at 100 messages in this group, which is especially annoying when I am at work or this morning when I was sleeping.
    I have an iPhone 5, and I really do not want to go in and disable all of the group message features, because I have several with my family and would to still be able to use those. Please tell me that there is a way to get out of a single group message. Thanks for the help.

    There is, currently, no way to get out of a group iMessage other than asking the person who started such to remove you, or:
    Show up at their house with two enforcers & "politely" ask that you be removed .

  • How can I get an "Overflows" frame property in IDML?

    I am using InDesign CS5.
    In scripting, I can get the "Overflows" property to see if a given text frame requires overflowing. I could not find any similar property in IDML. Is there any way to determine solely from an exported IDML if text overflow is required? By this, I mean that the story is too long to be displayed in its entirety and thus a continuation text frame needs to be displayed.
    What I am trying to do is to take an IDML, check on each text frame to see if there is undisplayed text due to a "too-small" frame, and if so take requisite action. Any IDML-based suggestions, workarounds, or pointers would be gratefully accepted.
    TIA,
    mlavie

    IDML contains unformatted text, and you cannot see how much space is going to take up when opened with InDesign -- it's InDesign itself that does all the formatting, word-breaking, justification, paragraph composing and all the rest. IDML only defines the pages, the frames, and the text that's going into it.

  • Can't get Aero theme forced (via Group Policy)

    Well I'm at a loss.  I have a bunch of users.  They're all crazy, and I think I'm getting there too.  It all started with this three-armed monkey that got loose in the lab....
    Ok seriously.  I'm having no luck getting the Aero theme forced to any user.  2008 R2 and Win 7 Pro and Enterprise systems.  Any user can easily manually set their own Aero theme and it saves after they log off, but for a user that hasn't
    done this I cannot get GPO's to get the job done. 
    I've been all over the web, some people say use the option to "Load a specific theme" which most people agree only affects a user's login for the first time.  After they've logged in once, that setting never applies to them again. 
    And the other one is that if I want to force the theme each time someone logs on, to set the msstyles file under "force a specific visual style file or force Windows Classic".  I don't have a company-specific file to share over a network folder
    so I just use the default %windir%\resources\Themes\Aero\aero.msstyles path. 
    Both of these GPO entries are found under User config > Policies > Admin Templates > Control Panel > Personalization. 
    Some forum posts say not to enable these two items together, others say you need to.  For me it doesn't work in any combination - plenty of machine reboots in between to ensure updated GP's get applied.  . 
    Also the Desktop Window Manager Session Manager service is running and set to automatic, and I've tested on more than one system so I am confident the computers are not the problem (some are brand new installs). 
    Event logs show no errors at all, and also do show successful applies of "4 group policy objects".  I suppose I should count how many are supposed to apply to a computer but let's say for argument's sake that there are no errors on this. 
    Is there something I'm missing? 

    I've been all over the web, some people say use the option to "Load a specific theme" which most people agree only affects a user's login for the first time.  After they've logged in once, that setting never applies to them again. 
    And the other one is that if I want to force the theme each time someone logs on, to set the msstyles file under "force a specific visual style file or force Windows Classic".  I don't have a company-specific file to share over a network folder
    so I just use the default %windir%\resources\Themes\Aero\aero.msstyles path. 
    For the "Load a specific theme" policy, you can find the description of the policy in group policy editor, it is only applied when a new user logs in for the first time and it doesn't prevent user from changing the theme
    I made a test in my environment, if I applied "force a specific visual style file or force Windows Classic". it works as I want (I use some default visual style file because I don't have customized file ), after that, I can change the
    theme, and the aero.msstyles I set via GP remain take effects.
    Regards
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How can I get values from a checkbox group?

    I have been developing a web application with Creator EA 2 and am trying to finish all the functionality before switching to 2. The last thing I have to do is pick up the status of checkboxes that I put in the page with the checkbox group component. Getting stuff from other fields is easy in the code for the page with a statement like: this.fieldname.getText() or ...getValue(). When you enter a line like this, Creator is helpful and gives you the completion choices. I tried some for the checkbox group, but none seem to give me what I want. What I want is the status ( true or false, 0 or 1, ...) for each checkbox in the group. I would appreciate advice on a simple way to get this. Thanks.

    You do not necessarily need to bind selected to an array. You might do that if you want to put the array in a session bean, but otherwise, the binding isn't necessary.
    Earlier, I provided a link to the Delving into Components tutorials. Here is an excerpt:
    "For the items property, you specify a display label and a return value. The selected value returns an array of objects of the same type as the return values. If you use a Default Options component to specify the items and return values, selected returns an array of String objects.
    The values in the selected array match the return values of the selected checkboxes."
    To illustrate, here is how to get the selected values without binding to an array. In this example, the id for the drop-down list is dropdown1.
        public void prerender() {
            if (checkboxGroup1.getSelected() != null) {
                String str="You selected ";
                String[] userSelections = (String[]) checkboxGroup1.getSelected();
                for (int i=0; i < userSelections.length; i++) {
                    str+= userSelections[i] + " ";
                staticText1.setText(str);
        }Hope this helps,
    Chris

  • Can't get  rectangular bounds of a Group

    In the program below, I expected the rectangle to be drawn around all the widgets in the testGroup but rectangle is only drawn around Button1. Tried boundsInLocal, boundsInParent, boundsInScene and layoutBounds without success. Any clues?
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.shape.Rectangle;
    import javafx.ext.swing.SwingButton;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Text;
    var testGroup : Group;
    testGroup = Group {
    content: [
    VBox{
    spacing: 10
    content: [
    SwingButton {
    text: "Button1 "
    action: function() {                       
    SwingButton {text: "Button 2"
                        action: function() {
    Text {font: Font {size: 12}
    textOrigin : TextOrigin.TOP
    content: "HelloWorld"
    Stage {
    title: "MyApp"
    scene: Scene {
    width: 500 height: 500
    content: [           
    Rectangle {
    width : testGroup.layoutBounds.width
    height: testGroup.layoutBounds.height
    fill: null;
    stroke: Color.BLACK
    testGroup
    }

    Rectangle {
       width: bind testGroup.layoutBounds.width
       height: bind testGroup.layoutBounds.height
       fill: null;
       stroke: Color.BLACK
    }You need to bind because when the Rectangle is created, the Group doesn't have the correct width and height yet.

  • Get Password Expiration Date of Group members in Active Directory

    hi,
    How can I get password Expiration date of Group members in Active Directory – please advise me
    Fasil CV

    Or DSQUERY Commands.
    dsget group "CN=Group1,DC=myinfralab,DC=com" -members | dsget user - -acctexpires
    Santhosh Sivarajan | Houston, TX | www.sivarajan.com
    ITIL,MCITP,MCTS,MCSE (W2K3/W2K/NT4),MCSA(W2K3/W2K/MSG),Network+,CCNA
    Windows Server 2012 Book - Migrating from 2008 to Windows Server 2012
    Blogs: Blogs
    Twitter: Twitter
    LinkedIn: LinkedIn
    Facebook: Facebook
    Microsoft Virtual Academy:
    Microsoft Virtual Academy
    This posting is provided AS IS with no warranties, and confers no rights.

  • How can we get the reference of XML element on frame as soon as frame is created in Document?

    Hi,
    When ever we copy any text/table cells from any frame, and paste it directly on page, A new Frame is created and the pasted text is placed inside that frame.
    Now to capture this frame creation, We have two possible solutions:
    1) Attach Observer on Document 'kDocBoss' on IID_IHIERARCHY_DOCUMENT and it will notify on frame creation in update function.
    2) Notification event on new story creation.
    Now, I need to perform some changes in the newly created table, for example:
    a)  Need to delete XML tags from newly created frame
    b)  Need to perform action on table cells if any in the created frame.
    But the problem is, when the event comes, I can access basic properties of frame like it's name, type etc, but it does not give me the
    XML element on frame or tables in frame until the event is com pleat.
    I know it's quite a specif requirement, but I guess many of you might have faced these kind of challenges, while processing the event.
    Does any one has any idea how I can get the reference of XML element on frame as soon as it is created?

    Hi Kapoor,
    please give also others a chance, and excuse that I get up late on vacation ;-)
    Anyway, I'd keep the story creation responder to recognize the copy, then combine it with an observer on the backing xml story to catch the associated XML element which is created there. Something like below:
    UIDRef xmlStoryRef = Utils<IXMLUtils>()->GetBackingStore(doc);
    InterfacePtr<ISubject> subject ( xmlStoryRef,IID_ISUBJECT );
    subject->AttachObserver(observer,IID_IIDXMLELEMENT,observer->GetAttachIID());

  • How can i get a component from frame?

    how can i get a JTextField component from the frame?
    in my program i use button and text fields, when button is pressed the action listener performs the needed actions: it must take the values in the text fields and do something with them,
    for example i have a button - view:
    look at the comments
    public class _ActionListener_search implements ActionListener {
         private JFrame frame;
         private database dtbs;
         public _ActionListener_search(JFrame frame, database dtbs) {
              this.frame = frame;
              this.dtbs = dtbs;
         @Override
         public void actionPerformed(ActionEvent arg0) {
              if (arg0.getActionCommand().equals("view_person"))
                                            //HERE i want to get values from text fields!
                                            //i need to get JTextField component from frame and use it
    view.addActionListener(new _ActionListener_search(frame, dtbs));how can i do it?
    is this a correct way?

    Encephalopathic wrote:
    If you know that you're going to need the data held in them why not give the class that holds them a public method that returns the Strings that they hold.
    public String getTextFieldXyzText()
    return textFieldXyz.getText();
    }Then if your actionlistener has a reference to this class's object, it can simply call the above method.That's what I was thinking. The view has a method getXyzText() and the listener (or some larger, enclosing controller) knows the view.
    What I would get away from is a single, switch-board listener hooked to a 100 unrelated buttons.

  • [AS CS5.5] Bad Perfomance: sequentially using DOM to get references

    Hi guys,
    The issue
    I'm having terrible performance problems when using a complex script I wrote.
    The script
    I need to make some special comparisons between found text and the texts in that page.
    My script is written in Flash Builder 4, using the CS_SDK (without Extension Builder)
    In short, my script has a class that performs the following tasks:
    1. Finds texts that meet some criteria (by using Document.findText() method) and stores the Array of texts result in an array.
    2. Traverses the Array of found texts and, for each one of them:
    a. Finds a reference to the page where that text is. Something like (within a for loop, with iFoundText as the indexing var):
    var currentParentPage     :Page     =
         foundText[iFoundText].parentStory.textContainers[0].parentPage;
    b. Finds all the page items in that page. The code goes something like this:
    var myPageItems      :Object     =
         currentParentPage.allPageItems;
    c. If the PageItem is a TextFrame, then make the 'special comparison', word by word.
    if (currentPageItem is TextFrame)
              var allTheWords     :Words =
                   currentPageItem.words
              for (var iWord:int = 0 ; iWord < allTheWords.length ; iWord++)
                   //Code to perform comparison and related operations...
    It seems to work OK, when allowing to perform the script for he first three occurrences (although very slow, say some 12 seconds for this).
    So, what's the problem?
    What happens when I run it with more load:
    When I run the script for all the occurrences (I know that the number is around 100), the application halts, an stops responding. After 10 min it doesn't work anymore.
    What the documentation says:
    I found a document called "FEATURE DEVELOPMENT WITH SCRIPTING - Adobe CS5" (link), where it gives this recommendation:
    Performance techniques
    Minimize access to InDesign DOM
    Querying the InDesign DOM may be the main performance bottleneck for your script. A considerable amount of time typically is spent resolving object references, because InDesign does not hand out pointers to objects but rather uses references that need to be resolved every time they are used. Here are some techniques to alleviate this problem:
    z Reduce the number of calls to the scripting DOM.
    z Store and reuse resolved references in variables wherever possible.
    z Use everyItem() to fetch and cache data of a collection object all at once, instead of querying the properties with separate calls.
    But I don't know how to not query InDesign's DOM every time...
    So. I understand that calling InDesign's DOM is bad for the script's performance, but I really don't know how could I avoid querying it for getting references to parent objects, or any other item.
    I have two questions
    1. If I have a variable stored in my AS script, for example:
    var anyTextItem:com.adobe.indesign.Text
    When I call a property or a method of that variable... Am I querying InDesign's DOM? (in other words, the variables' content is passed as a reference?)
    2. How do I query the DOM less times?
    For example:
    Problem: I constantly need to know what's the parent page of a found text, and then get the array of page items, and then, the array of words of every page item that is a textframe.
    How could I query the DOM once and then play with the stored variables instead of repetitively querying the DOM?
    Because, even if I have the variable stored, say "anyTextItem:Text", and I also have all the document's TextFrames stored in other variable (say "var allTextFrames:TextFrames"), I would still need to call "anyTextItem.parentTextFrame" to get a reference to the containing textFrame, and that would mean "querying InDesign's DOM".
    I would appreciate if anybody understands how to solve this.
    Thanks you, guys !

    Harbs,
    Thank you very much for your answer. You're very knowledgeable about InDesign DOM.
    Your message gives me a better understanding of how objects are managed between a scripting environment and the DOM. I still have some questions, though...
    b.
    I will change the call to 'allPageItems' to 'page.textFrames.everyItem().getElements()'. It makes much more sense.
    Now, quick question:
    What do you use 'getElements()' for?
    What's the diference between calling 'page.textFrames.everyItem().getElements()' and 'page.textFrames.everyItem()'?
    c.
    OK. I kinda got it. But, I have questions here too.
    For me, it's been quite tricky to understand indexes and references for InDesign DOM objects.
    Let's say that I have stored a Story's words object in my script. Something like:
    var currentWords     :Words = currentStory.words;
    And then, I go through a TextFrame that contains part of that Story, and find one word that meets my criteria. So I get:
    var foundWord        :Word = (... Somehow I got a reference to this ...);
    Is it there a way to easily find that word (by index) in the 'currentWords' object? (maybe using index or id...) The problem is that I've found that sometimes the indexes don't match (i. e. if I call "foundWord.index", its index can be way larger than the parentStory.words.length, for example, I got foundWord.index=942, whereas foundWord.parentStory.length=742).
    And, as a consequence, I'm using long workarounds to find the word within that collection (and I guess you'd scold me for this one; now I think that might be a serious performance killer, because I'm reconstructing the 'words' collection over and over again :S)
    Thanks again to both of you (@Harbs and @Andrés), you've been very kind and helpful.

  • Adobe CR 6.7 does not install into CS5, how can I get this installed to view CR files?

    Just installed CS5 onto new computer. Adobe bridge and CS5 do not recognize CR format. How can I get this installed. I have tried up dating and downloading the CR6.7 update, but can not get it to install. What do I do?

    Product updates

Maybe you are looking for

  • IPod Nano 3rd generation error -50

    When attempting to sync photos into iPod Nano , unexpected error -50 occurs, and is unable. We have latest version of iTunes 8.2 (23). What do we do??

  • Found: Best Settings for Photo Slideshow

    Hi, I have become very frustrated with iMovie. It does a terrible job of rendering a photo only slideshow if you burn it to DVD. Someone suggested to used the medium export for Standard Definition, but I think I've found the trick. 1. Open iMovie 2.

  • Live ps 3d

    I'm confused that the window check box "photoshop live 3d" is missing in AE CS6.. then how will we import a 3ds/obj (psd) with its 3d property?

  • AD RMS MDE. RMS Sharing App error

    Hi! Sorry for my english. Recently I have raised AD RMS on-premises environment according to document "Leverage-the-Mobile-Device-Extension-for-AD-RMS-on-your-premises.docx". In my case I used only local network infrastructure (without Azure). Then I

  • Tax Code Import

    What is the best way to import the shipping address Tax Code?  (CRD1, TaxCode) What is the field in the DTW?  or the DI API?  In SAP - under Administration>>Data Import>>Import from Excel - what is the Tax Group field?  I have tried putting the tax c