Get parent of undefined  is it possible?

My script is resizing object when the context is "Text" i.e. there is some insertion point. I use this code to get object to resize:
if (selection[0].constructor.name = "InsertionPoint")
objectToResize = selection[0].parentTextFrames[0];
It works good until cursor is visible. But when object becomes small enough cursor goes out of visible area and "selection[0]" is undefined. How can I get access to the object in this case?

Full source code:
with (app) {
for (i = 0; i < selection.length; i++) {
var objectToResize = selection[i];
switch (objectToResize.constructor.name) {
case "InsertionPoint": case "Character": case "Text": case "Word": case "Paragraph": case "TextColumn":
objectToResize = objectToResize.parentTextFrames[0];
var myBounds = objectToResize.geometricBounds;
delta = activeDocument.gridPreferences.horizontalGridlineDivision / activeDocument.gridPreferences.horizontalGridSubdivision;
myBounds[3] = myBounds[3] + delta;
objectToResize.geometricBounds = myBounds;
Error appears at line:
var myBounds = objectToResize.geometricBounds;

Similar Messages

  • Problem with Jtree to xml tranform..how to set/get parent of a node?

    Hi,
    I am trying to develop xml import/export module.In import wizard, I am parsing the xml file and the display it in Jtree view using xml tree model which implements TreeModel and xml tree node.I am using jaxp api..
    It is workin fine.
    I got stuck with removal of selected node and save it as a new xml.
    I am not able to get parent node of selected node in remove process,itz throwing null.I think i missed to define parent when i load treemodel.Plz help me out..give some ideas to do it..
    thanks
    -bala
    Edited by: r_bala on May 9, 2008 4:44 AM

    there's no way anyone can help you without seeing your code.

  • APEX 4.0 Getting gReport is undefined when pulling IR report from Page2

    The below function used work perfectly in APEX 3.2 for
    Pulling Page2 IR Report into Page1 Region having <div id="XXHOLDER">
    <div>
    but in APEX 4.0, I am getting "gReport is undefined" when I click on IR Toolbar/Control panel like Action or Go
    function periodRep(){
    $.ajax({
    type: "POST",
    url: "wwv_flow.show",
    data: {
    p_flow_id : $v('pFlowId'),
    p_instance : $v('pInstance'),
    p_flow_step_id : "2",
    p_request : ""
    dataType : "html",
    success : function(data){
    var startTag = '<apex2ajax>';
    var endTag = '</apex2ajax>';
    var start = data.indexOf(startTag);
    if (start > 0) {
    data = data.substring(start+startTag.length);
    var end = data.indexOf(endTag);
    data = data.substring(0,end);
    $("div#XXHOLDER").html(data);
    $x_Value('pFlowStepId', "2");
    if($('#apexir_CONTROL_PANEL_COMPLETE').length > 0){
    if(!($('#apexir_CONTROL_PANEL_COMPLETE').css('display') == 'none')){
    gReport = new apex.worksheet.ws('');
    gReport.toggle_controls($x('apexir_CONTROL_PANEL_CONTROL'));
    }); //ajax
    }//periodRep
    Please help
    Thanks
    -Senthil K

    Hi Senthil,
    I think that the reason this no longer works is due to internal changes we made to the Interactive Report JavaScript. These changes affected both how the IRR JS file was added to a page and also how the gReport variable is initialised.
    I would like to give you a few pointers as to what's changed and how you can get this working, but please bear in mind that doing these types of customisations is always going to be risky, due to the fact undocumented HTML that we output is always subject to change in future releases of APEX and cannot be relied upon as remaining the same.
    In 4.0, the IRR JS file is only included on a page where there is an IRR, so you're page 2. And unfortunately, due to the way you crop your response from page 2, this file is not being included in page 1 after the PPR. You therefore either need to change the way you crop the success data, or just include the apex_interactive_reports_4_0.js file on your page 1.
    Also in 4.0, we have also cleaned up a lot of initialisation JS code that we used to emit inline, that is now added at the end of the web document in a jQuery 'ready' handler. 1 such example of this code was the initialisation of the gReport variable in IRRs. This used to be emitted inline and was actually included inside of the snippet you crop within page 2 response. Which was all good. Now though, because this is done at the end of the response, which is outside of what you crop, this is no longer executed. Try adding the following initilialisation at the end of you 'success' callback:
    gReport = new apex.worksheet.ws('');
    gValid = new apex.validation.v();Again, to re-iterate!! Internal and undocumented code such as this is always subject to change and should not be relied upon as remaining the same in future releases of APEX. Only supported APIs and methods should be relied upon as being backwards compatible.
    Anthony.
    Edited by: Anthony Rayner on Jul 26, 2010 5:46 PM

  • Hello Everyone, I just bought a HP Photosmart Premium All-in-One Printer - C309g but i find it very difficult to connect to it via BLUETOOTH and WIRELESS on my IPAD 3...i will be very greatfull if i'll get a solution as soon as possible. Thanks

    Hello Everyone, I just bought a HP Photosmart Premium All-in-One Printer - C309g but i find it very difficult to connect to it via BLUETOOTH and WIRELESS on my IPAD 3...i will be very greatfull if i'll get a solution as soon as possible. Thanks

    Hi Tomiwa,
    You cannot print from the iPad to that printer. AirPrint and Bluetooth are completely different.
    There may be apps you can buy that will enable using that printer, but that is not an ideal solution.
    That particular printer has had many bad reviews, and is unreasonably expensive for its features. Considering that you just bought the printer, as well as its lack of AirPrint, I suggest you return it and buy a printer that supports AirPrint.

  • When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it

    When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it?

    The issue is that your credit or debit card credentials must be associated with the same country where you reside in order to purchase iTunes content.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location. You can use the iTunes Store in all countries of which you’re a resident, but you’ll either need a separate iTunes Store account for each one, or you’ll need to continually be switching the billing information on your single account. Generally, it’s simpler just to set up an alternative account for these situations, although it’s worth nothing that features like iTunes in the CLoud and iTunes Match are designed to work best when using a single iTunes Store account, as you can only switch accounts with these services every 90 days."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • Get Parent node from Base member

    Hi ,
    My user select base member from CV .
    I want parent node for that base member .
    I am using =EVPRO( App name , memmber id , "PARENTH1" ) .
    I am not getting parent member from this funcation .
    Pls let me know any other way for this ?
    regards,
    PSR

    Hi,
    EVPRO for getting the value for PARENTH1 of any member should work. Please check whether you have included all the parameters of this function inside double quotes.
    EVPRO("APPNAME","MEMBER_ID","PROPERTY")
    Hope this helps,
    Regards,
    G.Vijaya Kumar

  • Get parent window in webutil

    Hi,
    I am trying to migrate 6i libraries to 10g in Orcle forms, in one of the pll it is using below procedure.
    In this it is calling wi_api_utility.get_parent_window procedure, which is part of d2kwutil.
    Now I have to use webutil instead of d2kwutil, becuase d2kwutil will not supported for webforms.
    Is there any same procedure avaialble in webutil to replace win_api's get_parent_window?
    If anyone knows solution for this please help me.
    Thanks.
    PROCEDURE Window_On_Top (Window_Name IN WINDOW) is
    hWnd PLS_INTEGER;
    hParent PLS_INTEGER:=1;
    iRC PLS_INTEGER;
    BEGIN
    hWnd := to_number(get_window_property(Window_Name,WINDOW_HANDLE));
    hParent := win_api_utility.get_parent_window(hWnd,TRUE,FALSE);
    IF hParent <> 0 THEN
    hWnd := hParent;
    END IF;
    iRC := i_SetwindowPos(fh_SetWindowPos,hwnd,-1,0,0,0,0,19);
    END;

    Hi,
    Solved.
    If alias name of parent databank always remains same, then you can directly use +"{{db.aliasName.ColumnName}}"+
    Otherwise, to get parent databank alias name use
    ScriptPackage parentScript= utilities.getCurrentVUSer().getParentUser().scriptPackage;
              ArrayList<String> parentDB = parentScript.getDatabankAliases();
    +info(eval("{{db."+ parentDB.get(0) + ".ColumnHeader}}"));+
    Regards,
    *Deepu M*

  • Get parent Collectionset in create Collection

    Hi All,
         In Create Collection, How to get parent collectionset.
    Thanks,
    Dung

    I think you want to post this in the Photoshop Lightroom forum (this is the Lightroom SDK forum, for plugin authors).
    Or have I misunderstood the question? (collection:getParent() to get parent in lua code).
    Or are you trying to call the catalog function to create a collection, but don't know what to use for parent collection set? If this is the case, then you will have to create a collection set if you can't find something suitable to act as parent (e.g. a selected collection set obtained from catalog:getActiveSources()). Reminder: parent parameter is optional - if omitted, then collection will be created in root of catalog (or publish service) - that's another option.
    Most of my plugins that create collections create a collection set in the root, named after the plugin, and put all sub-collections/sets in it.

  • Get parent databank in a child scipt

    Hi All,
    Is there any method to get parent databank in a child script. Currently I'm using variables to pass data from parent script to child script.
    Appreciate if anyone helps me to solve this scenario.
    Regards,
    Deepu M

    Hi,
    Solved.
    If alias name of parent databank always remains same, then you can directly use +"{{db.aliasName.ColumnName}}"+
    Otherwise, to get parent databank alias name use
    ScriptPackage parentScript= utilities.getCurrentVUSer().getParentUser().scriptPackage;
              ArrayList<String> parentDB = parentScript.getDatabankAliases();
    +info(eval("{{db."+ parentDB.get(0) + ".ColumnHeader}}"));+
    Regards,
    *Deepu M*

  • Get parent component

    Hi all,
    Is there any method to get parent component (container) of a jcomponent?

    Did you think to look at the API? Some method names are obvious. Other are not. The least you can do is try. All you had to do was find any method with the word "parent" in it.

  • Getting Parent Consolidation Groups for a given Consolidation Unit

    Hi Friends,
    I am writing a program wherein i need to get parent Consolidation Groups and their Hierarchy levels for a given Consolidation Unit. If anyone has worked on a similar requirement, Please provide me with Function module or logic for the same.
    Thanks
    Surya

    hi,
    asset-nr = ILOA-ANLNR
    Andreas

  • How do i change birthday and get parent approval

    We created a account for our son but we used a different b-day. how do change is birthday and get parent approval. He is a minor.

    Hi mmitchell619,
    Welcome to the Apple Support Communities!
    I understand that you would like to edit the birth date for your son’s Apple ID. To change the birthday, please use the steps located in the following article. 
    Update the birth date associated with your Apple ID - Apple Support
    Best regards,
    Joe

  • I wonder if I can get the lyrics (lyrics) are scrolled on the screen, as most lyrics is very large, and can almost never get the entire text box. is possible to make each verse appears, while the audio playback?

    I wonder if I can get the lyrics (lyrics) are scrolled on the screen, as most lyrics is very large, and can almost never get the entire text box. is possible to make each verse appears, while the audio playback? please help me???

    Just connect the new iPod to your computer and setup the iPod via iTunes (instead of via wifi).
    If you want to copy all the infor from an old iPod touch to the inew iPod see:
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • How to get parent controls reset

    how to get parent control reset or changed

    You would have to log in as the administrator, then use the Parental Controls panel in System preferences to change the account's controls.
    Matt

  • I'm using AOL for email and Firefox 9.0.1. Problem started 2 days ago. Before that I put in the first two letters of an email address and it gave me a list of possibles. Now I get "undefined" for each possible instead of the email address.

    After updating to Firefox 9.0.1 there were no problems. My contact list still shows as it did before this problem arose. When I type in the first letter or two of the email address, it used to give me a list of possibles. Now t is just showing the email address as "undefined" when it gives me suggestions for the email address I'm typing in the send line. This means that instead of being able to click on my choice in the possibles it gives me, I have to go to my contact list, find the name and then click on it if I'm sending the email to one person. If it goes to more than one, I either have to type in the full address or use copy and paste from the contact list. This is a huge hassle. Any help is appreciated.

    I moved the file formhistory.sqlite to another file folder. I then started Firefox up again to see if it worked or if I needed to start it in Safe Mode. No need for Safe Mode. It now works exactly as it should. Thank you so much!!

Maybe you are looking for