How can I find the index from a specific container?

How can I find the index from a specific container?
For example, if I'm traversing through textframes like so (an example, not tested):
var doc = app.activeDocument;
var story = doc.pages[0].textFrames[0].parentStory;
for (var i=0, l=story.textContainers.length; i<l; i++) {
     var textFrame = story.textContainers[i];
     if (textFrame.constructor.name == "TextFrame") {
          var lastPara = textFrame.paragraphs.lastItem();        //How can I find the index of this in relation to the story?
How can I find the index of "lastPara" in relation to the story rather than the current container?
I tried:
var newPara = story.paragraphs[lastPara.index];
but this results in an invalid object. . .
alert(newPara.isValid);      //returns false

The .index property is the character offset. So lastPara will begin at story.characters[lastPara.index].

Similar Messages

  • How can we find the web from the url

    Hi Team,
    I just need inputs:
    I have URL's as below:
    https://sharepointwebapp.com/departments/service/Documents/test.docx
    https://sharepointwebapp.com/departments/course/Documents/test.pdf
    Here, test.docx is available in "service" subsite.
    test.pdf is available in "course" subsite.
    How can I get the current web based on the document in code.
    Please let me know.
    Sandeep
    Krishnasandeep

    Hi,
    Refer to the below table.
    SPSite Constructor
    OpenWeb Method
    Site Returned
    http://Server/Folder/File
    There is no parameter (OpenWebmethod overload)
    http://Server
    http://Server/Subsite1/Subsite2/Folder/File
    There is no parameter (OpenWebmethod overload)
    http://Server/Subsite1/Subsite2
    http://Server/Subsite1/Subsite2/Folder/File
    http://Server
    http://Server/Subsite1/Subsite2/Folder/File
    /Subsite1
    http://Server/Subsite1
    http://Server/Folder/File
    Subsite1/Subsite2
    http://Server/Subsite1/Subsite2
    http://Server/Folder/File
    /SiteCollection/Subsite3
    Error: There is no site named/SiteCollection/Subsite3
    http://Server/Folder/File
    /Subsite4
    Error: There is no site named /Subsite4
    http://Server/sites/SiteCollection/Subsite3/Folder/File
    No parameter (OpenWeb method overload)
    http://Server/sites/SiteCollection/Subsite3
    http://Server/sites/SiteCollection/Folder/File
    /sites/SiteCollection/Subsite3
    http://Server/sites/SiteCollection/Subsite3
    http://Server/sites/SiteCollection/Folder/File
    Subsite3
    http://Server/sites/SiteCollection/Subsite3
    http://Server/sites/SiteCollection/Folder/File
    Error: Invalid URL
    http://Server/sites/SiteCollection/Subsite3/Folder/File
    /sites/SiteCollection
    http://Server/sites/SiteCollection
    http://msdn.microsoft.com/en-us/library/ms474633.aspx

  • We just received our new mac and took it to the store to have the old files from our last computer transferred over.  Now we can't find all our files.  There was more then one user on the old machine.  How can we find the files from the other users?

    We need to find where the files for the other user on the computer are now located.  There were two other users on the old machine, which was taken into the store and ALL files were suppose to be transferred over to this computer. HELP!

    It appears what happened is the installer though it was looking at a empty drive and just went ahead and installed.
    I of course am assuming here you didn't use Disk Utility to format the drive first before installing, that would wipe out your files and programs for sure.
    So what to do, what to do.
    Well there is hope for you as long as the drive wasn't Filevaulted.
    I'll explain. When a hard drive writes data for the first time to a drive, it starts at the very top and works it's way down.
    When OS X was installed the first time, it was at the top of the drive, unless you upgraded then the upgraded OS X could have been written elsewhere.
    Now when you just reinstalled OS X, the new OS went on the top of the drive, overwriting any data that was there previously, so what was there you have lost forever which is about 8GB or so. If it was the previous OS there, then your more in luck because only the old OS X was overwritten.
    The remaining space on the drive still can have a copy of your files, provided it's not overwritten yet.
    It's because when a hard drive deletes data or reformats, it doesn't remove the data off the drive or overwrites it immediately, it's just made so it's SPACE is available for new files to be written there.
    So technically one can recover the deleted data off a non-encrypted/scrubbed hard drive with special software.
    The way it does this is it reads the 1's and 0's of the files themselves, and through a lot of figuring out, can tell what that file is and what it belongs too.
    So what you will have to do is this:
    Create a data recovery/undelete external boot drive
    or if you don't have the skills, then take it to a local PC/Mac tech and they can do a direct image of the drive and then you can run Data Rescue on it to rebuild your files.

  • I am trying to download xfinity tv go app. I can not find it in my App Store and can not download it from the comcast website. All I get is a blank screen in the App Store. My Apple ID is associated with a Canadian address. How can I find the app?

    I am trying to download xfinity tv go app. I can not find it in my App Store and can not download it from the comcast website. All I get is a blank screen in the App Store. My Apple ID is associated with a Canadian address. How can I find the app?

    Its possible the App is not available in the Canadian store if the link doesn't work for you.
    https://itunes.apple.com/us/app/xfinity-connect/id320788270?mt=8

  • How can I find the serial number for my creative suite CS6 I bought it from a store.

    How can I find the serial number for my creative suite CS6 I bought it from a store.

    https://www.adobe.com/account.html for serial numbers or subscriptions on your Adobe page... or
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • How can i find the option to delete a recent print job from the "View Job History

    1. Photosmart 5510 e-ALL-IN-ONE SERIES
    2. Window 7 64 bit
    How can i find the option to delete a recent print job from the "View Job History

    Hello alfmswongg,
    Currently there is no option to delete print jobs from the "View Job History" section of ePrintCenter.  
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How can I find a photo from the backup file in my pc?

    How can I find a photo from the backup file in my pc?
    I have accidentally erased a photo. It happened after the backup.

    I am not aware you can extract a single photo or a single app's content from the backup, you can either restore the whole backup to your phone or not restore. If you restore your last backup to your phone then any content that is currently on your phone will be replaced with what was on it at the time that the backup was made - so if you do decide to restore, first copy off any purchases to your computer's iTunes via File > Transfer Purchases, and copy any documents/files that you've udpated on the phone since the backup.

  • How can i find the original picture in the correct event folder from an album folder picture?

    how can i find the original picture in the correct event folder from an album folder picture? I can find the link to the original event folder, but is there a way to get right to the picture without having to search visually the event folder?

    Depends on whatr you mean
    Deleting from your phone does not delete from anywhere else
    HOWEVER deleting from your Photo stream does delete from the Photostream so anyone looking at the PS from any device will no longer see the photo
    But if your Mac iPhoto is set to automatically impor tphotos form PS or is you have manually imported photos from PS then onc ethey are imported they are on your Mac and change to PS will not affect them
    for more on PS see http://support.apple.com/kb/HT4486?viewlocale=en_US&locale=en_US
    LN

  • Moving adobe 9 standard from 1 machine to another. How can I find the activation code on the old machine to activate on new machine

    moving adobe 9 standard from 1 machine to another. How can I find the activation code on the old machine to activate on new machine?

    You didn't really clarify much, just repeated the same question. First of all, Adobe is a company with many products.
    Are you talking about Adobe Acrobat? If so you need to deactivate it on the old machine and then use enter the serial-number (as described) when installing it on the new machine. It will then activate itself automatically over the internet. Just keep in mind that Acrobat 9 is not compatible with Windows 8 and to make it compatible with Windows 7 you have to update it to at least version 9.2 after the installation.

  • Hi. My 2013 MacBook Air has suddenly reverted to a previous Excel spreadsheet (from May). I use the same spreadsheet several times a day and hit cmd 's' every 5-10 minutes. How can I find the version I was using yesterday?? Please help. Thanks

    Hi. My 2013 MacBook Air has suddenly reverted to a previous Excel spreadsheet (from May). I use the same spreadsheet several times a day and hit cmd 's' every 5-10 minutes. How can I find the version I was using yesterday?? Please help. Thanks

    Might be something for you here > Automatically save and recover files - mac excel

  • HT200164 How can i find the serial number of a Logic Pro  downloaded from AppStore. (Without any booklet)

    How can i find the serial number of a Logic Pro  downloaded from AppStore. (Without any booklet)

    Hi
    The Appstore version does not require a serial number
    CCT

  • How can we find the list of user exits for a transaction

    hi all
    iam new in user exits please send the basic details
    how can we find the list of user exit for a perticular transaction and how can we determine that a particulr user exit is used for a field
    regards
    jagadish

    hi,
    check the below links for userexits
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    FAQ's
    http://http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
    http://www.easymarketplace.de/userexit.php
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    1. what is the defference between enhancement and user-exits?
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    Re: difference between user exits & customer exits
    Some Questions ! Plz help...
    http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_gci1190924_tax299358,00.html?bucket=ETA
    2. Difference between CMOD and SMOD?
    http://www.sap-img.com/abap/what-is-the-difference-between-smod-and-cmod.htm
    http://www.sap-img.com/abap.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/diff-between-cmod-and-smod-236095
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/diff-between-cmod-and-smod-236107
    check these links..
    http://www.sapgenie.com/abap/tips_and_tricks.htm
    http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    passing selet-option variable to subrouine...
    Finding the user-exits of a SAP transaction code
    Finding the user-exits of a SAP transaction code
    Enter the transaction code in which you are looking for the user-exit
    and it will list you the list of user-exits in the transaction code.
    Also a drill down is possible which will help you to branch to SMOD.
    Written by : SAP Basis, ABAP Programming and Other IMG Stuff
                 http://www.sap-img.com/*
    report zuserexit no standard page heading.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
             tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
       select single * from tadir where pgmid = 'R3TR'
                        and object = 'PROG'
                        and obj_name = tstc-pgmna.
       move : tadir-devclass to v_devclass.
          if sy-subrc ne 0.
             select single * from trdir where name = tstc-pgmna.
             if trdir-subc eq 'F'.
                select single * from tfdir where pname = tstc-pgmna.
                select single * from enlfdir where funcname =
                tfdir-funcname.
                select single * from tadir where pgmid = 'R3TR'
                                   and object = 'FUGR'
                                   and obj_name eq enlfdir-area.
                move : tadir-devclass to v_devclass.
              endif.
           endif.
           select * from tadir into table jtab
                         where pgmid = 'R3TR'
                           and object = 'SMOD'
                           and devclass = v_devclass.
            select single * from tstct where sprsl eq sy-langu and
                                             tcode eq p_tcode.
            format color col_positive intensified off.
            write:/(19) 'Transaction Code - ',
                 20(20) p_tcode,
                 45(50) tstct-ttext.
                        skip.
            if not jtab[] is initial.
               write:/(95) sy-uline.
               format color col_heading intensified on.
               write:/1 sy-vline,
                      2 'Exit Name',
                     21 sy-vline ,
                     22 'Description',
                     95 sy-vline.
               write:/(95) sy-uline.
               loop at jtab.
                  select single * from modsapt
                         where sprsl = sy-langu and
                                name = jtab-obj_name.
                       format color col_normal intensified off.
                       write:/1 sy-vline,
                              2 jtab-obj_name hotspot on,
                             21 sy-vline ,
                             22 modsapt-modtext,
                             95 sy-vline.
               endloop.
               write:/(95) sy-uline.
               describe table jtab.
               skip.
               format color col_total intensified on.
               write:/ 'No of Exits:' , sy-tfill.
            else.
               format color col_negative intensified on.
               write:/(95) 'No User Exit exists'.
            endif.
          else.
              format color col_negative intensified on.
              write:/(95) 'Transaction Code Does Not Exist'.
          endif.
    at line-selection.
       get cursor field field1.
       check field1(4) eq 'JTAB'.
       set parameter id 'MON' field sy-lisel+1(10).
       call transaction 'SMOD' and skip first   screen.
    *---End of Program
    if u want to find the function exit
    then check the below code
    REPORT ZV_FIND_EXIT NO STANDARD PAGE HEADING.
    TABLES : TSTC, TADIR, MODSAPT, MODACT, TRDIR, TFDIR, ENLFDIR.
    TABLES : TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR WHERE FUNCNAME =
    TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'SMOD'
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT WHERE SPRSL EQ SY-LANGU AND
    TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(95) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Exit Name',
    21 SY-VLINE ,
    22 'Description',
    95 SY-VLINE.
    WRITE:/(95) SY-ULINE.
    LOOP AT JTAB.
    SELECT SINGLE * FROM MODSAPT
    WHERE SPRSL = SY-LANGU AND
    NAME = JTAB-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    WRITE:/1 SY-VLINE,
    2 JTAB-OBJ_NAME HOTSPOT ON,
    21 SY-VLINE ,
    22 MODSAPT-MODTEXT,
    95 SY-VLINE.
    ENDLOOP.
    WRITE:/(95) SY-ULINE.
    DESCRIBE TABLE JTAB.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No of Exits:' , SY-TFILL.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'No User Exit exists'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'Transaction Code Does Not Exist'.
    ENDIF.
    AT LINE-SELECTION.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(4) EQ 'JTAB'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    or
    1. in se11, goto table MODSAP
    View table contents
    2. in Type field, enter 'E' (for function exit)
    3. For that tcode, u should know the program name.
    eg. SAPLLMOB
    4. then type SAPLLMOB and execute
    or
    REPORT z34331_user_exit .
    TABLES : tstc, "SAP Transaction Codes
    tadir, "Directory of Repository Objects
    modsapt, "SAP Enhancements - Short Texts
    modact, "Modifications
    trdir, "System table TRDIR
    tfdir, "Function Module
    enlfdir, "Additional Attributes for Function Modules
    tstct. "Transaction Code Texts
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK a01.
    START-OF-SELECTION.
    Validate Transaction Code
    SELECT SINGLE * FROM tstc
    WHERE tcode EQ p_tcode.
    Find Repository Objects for transaction code
    IF sy-subrc EQ 0.
    SELECT SINGLE * FROM tadir
    WHERE pgmid = 'R3TR'
    AND object = 'PROG'
    AND obj_name = tstc-pgmna.
    MOVE : tadir-devclass TO v_devclass.
    IF sy-subrc NE 0.
    SELECT SINGLE * FROM trdir
    WHERE name = tstc-pgmna.
    IF trdir-subc EQ 'F'.
    SELECT SINGLE * FROM tfdir
    WHERE pname = tstc-pgmna.
    SELECT SINGLE * FROM enlfdir
    WHERE funcname = tfdir-funcname.
    SELECT SINGLE * FROM tadir
    WHERE pgmid = 'R3TR'
    AND object = 'FUGR'
    AND obj_name = enlfdir-area.
    MOVE : tadir-devclass TO v_devclass.
    ENDIF.
    ENDIF.
    Find SAP Modifactions
    SELECT * FROM tadir
    INTO TABLE jtab
    WHERE pgmid = 'R3TR'
    AND object = 'SMOD'
    AND devclass = v_devclass.
    SELECT SINGLE * FROM tstct
    WHERE sprsl EQ sy-langu
    AND tcode EQ p_tcode.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    SKIP.
    IF NOT jtab[] IS INITIAL.
    WRITE:/(95) sy-uline.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 sy-vline,
    2 'Exit Name',
    21 sy-vline ,
    22 'Description',
    95 sy-vline.
    WRITE:/(95) sy-uline.
    LOOP AT jtab.
    SELECT SINGLE * FROM modsapt
    WHERE sprsl = sy-langu AND
    name = jtab-obj_name.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    WRITE:/1 sy-vline,
    2 jtab-obj_name HOTSPOT ON,
    21 sy-vline ,
    22 modsapt-modtext,
    95 sy-vline.
    ENDLOOP.
    WRITE:/(95) sy-uline.
    DESCRIBE TABLE jtab.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No of Exits:' , sy-tfill.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'No User Exit exists'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'Transaction Code Does Not Exist'.
    ENDIF.
    Take the user to SMOD for the Exit that was selected.
    AT LINE-SELECTION.
    GET CURSOR FIELD field1.
    CHECK field1(4) EQ 'JTAB'.
    SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    Regards,
    Naveen

  • How can we find the most usage and lowest usage of table in Sql Server by T-SQL

    how can we find the most usage and lowest usage of table in Sql Server by T-SQL
    The table has time stamp column
    StartedOn datetime
    EndedOn datetime

    The Below query has been used , but the textdata column doesnot include the name of the table ServiceLog.
    SELECT
    FROM
    databasename,
    duration
    fn_trace_gettable('F:\Program
    Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\log_148.trc',
    default)
    WHERE
    DATABASENAME='ZTCFUTURE'
    AND TEXTDATA
    IS
    NOT
    NULL
    --AND TEXTDATA LIKE 'SERVICE%'
    order
    by cpu
    desc; 

  • How can I find the URL for an iCal calendar in iCloud so I can make a link to it on a web page.

    I have a single iCal calendar that I want people to access through my webpage.  How can I find the URL so that they can view the calendar without having to subscribe to it.  I converted to iCloud from .Mac and I can see that changes to this calendar are not showing up.

    Mmmh.. i see... I don't know wether it is possible for people just check calendars without subscribing to them... I have been sharing some calendars in my website (maybe you can have a look at it in order to check wether it could be a possible solution for you)
      http://web.me.com/andreabruschi/englishplanet/English_Courses.html
    Cheers
    Andrea

  • I have lost my phone IMEI  Number 012546005322381, Serial Number 87******A4S, is there a way it can be tracked? Also, how can one remove the device from the itunes account

    I have lost my phone IMEI  Number 012546005322381, Serial Number 87******A4S, is there a way it can be tracked? Also, how can one remove the device from the itunes account
    <Serial Number Edited By Host>

    If you enabled Find my iPhone then you should use that. If not, I'm afraid you're out of luck for finding it. 
    To manage your devices, go to Your Account in iTunes.

Maybe you are looking for

  • How to I get a "Outcome" in WAIT task when a deeadline is missed

    Hi Experts, I have a WAIT task in my Workflow for which I have maintained a "Latest End"  -> End Date and Recipient. I wanted to get a mail (or some text in recipient's inbox)  in case the deadline is missed. Can some one tell why i am unable to get

  • Open PDF Attachment with Adobe Reader put GW to background

    Hello all, We have problems with opening pdf attachments from GroupWise client 12.02 with Adobe Reader 11.0.06. The attachment opens fine, but when opening the attachment, the mail and GroupWise client immediately are placed to the background in Wind

  • Track user transactions

    Hi, We have a user ID that was expired a year ago. We want to know how to check the last transaction or last accessed tcode of the user. I tried Sm37 but there were no logs found. Thanks Law

  • Importing Software Components

    Hello all, I'm trying to build a RFC - XI - Web Service Scenario.  But to start I need to import my RFC that will comunicate with XI.  How do I do it? The RFC is hosted in an ECC 6.0 but there are too many components in the sofware catalog that I don

  • How can I send Apple my Ideas and founded Bugs?

    The Question is in the Subject ;)