How can I know which page of a document are an external reference using ExtendScript?

Hello

I want to know on what page in an external document XRef can be found. Y at - it a simple way to manage this using ExtendScript? The FrameScript equivalent is XRef.Page.PageNumString.

Thank you in advance.

Here's the function changed, which now requires an object doc as the second parameter.

function getPage (obj, doc) {

    var frame = 0, cell = 0;
    var objType = "", prop = 0;

    while (obj) {

        frame = obj;
        objType = obj.constructor.name;

        switch (objType) {
            case "SubCol" :
                obj = obj.ParentTextFrame;
                break;
            case "Tbl" :
                obj = obj.FirstRowInTbl.FirstCellInRow;
                break;
            case "Row" :
                obj = obj.FirstCellInRow;
                break;
            case "Cell" :
            case "Pgf" :
            case "AFrame" :
                obj = obj.InTextFrame;
                break;
            case "TextLine" :
            case "TextFrame" :
            case "UnanchoredFrame" :
            case "Arc" :
            case "Ellipse" :
            case "Group" :
            case "Inset" :
            case "Line" :
            case "Math" :
            case "Polygon" :
            case "Polyline" :
            case "Rectangle" :
            case "RoundRect" :
                if (obj.FrameParent.ObjectValid()) {
                    obj = obj.FrameParent;
                } else {
                    obj = 0;
                }
                break;
            case "XRef" :
                prop = doc.GetTextPropVal (obj.TextRange.beg, Constants.FP_InTextObj);
                var obj = prop.propVal.obj;
                break;
            default:
                // Prevent endless loop if unknown object type is found.
                obj = 0;
                break;
        }
    }
    if (frame) {
        return frame.PageFramePage;
    } else {
        return 0;
    }
}

Tags: Adobe FrameMaker

Similar Questions

  • Make a small change to an old project - how can I know which versions of drivers and RIO etc. has been used for the last good generation?

    If I want to make a small change to a legacy project for years before, I would limit my risk using the same exact versions of LabVIEW, etc. NOR-RIO.  So I check the project from the repo, but I do not know how to check what versions have been used when the last know good generation was carried out.  I don't want to introduce questions by recompiling mass to the latest version.

    What is advised in this case?  I could, before every posting of repo, take a screenshot of the tree of MAX software and save it in the project file.

    Any ideas?

    Rather than create a screenshot of MAX: MAX can create a report for you. You can take all the information expected of her.

  • How can I know which files I can delete safely on my C drive?

    I was told to delete some files as they took too much space, they told me to go to my computer, then click on my C drive... 1 million files showed up... how can I know which ones to remove?

    I was told to delete some files as they took too much space, they told me to go to my computer, then click on my C drive... 1 million files showed up... how can I know which ones to remove?

    See other responses, you got and let me add the following. If you are short on disk space, it is likely that there are some files that you don't need and you can delete them. But this generally record only a small amount of disk space and doesn't really help the problem. The only real solution to buy a bigger hard drive. Fortunately, they are very cheap these days.

  • I bought a laptop with a windows xp pro, I have the serial number, but I don't have the installation disc. How can I know which version I need? SP3 has not worked... at the moment I am testing SP1

    I bought a laptop with a windows xp pro, I have the serial number, but I don't have the installation disc. How can I know which version I need? SP3 has not worked... at the moment I am testing SP1

    I bought a laptop with a windows xp pro, I have the serial number, but I don't have the installation disc. How can I know which version I need? SP3 has not worked... at the moment I am testing SP1

    The serial number of the computer has nothing to do with the product key for Windows.

    What happened when you tried to install Xp with sp3? If you do not have the original for the computer that you use to install Windows?

    You can try to contact the manufacturer of the computer who may be able to provide the recovery disc. The disks are usually under $ 20.

  • How can I know which files fragmented, I can safely remove?

    original title: fragmentation of files

    How can I know which files fragmented, I can safely remove? Some of my fragmented files are system files.

    Fragmented files are not bad! At worst, need another millisecond or two for the system read this file.  If the file is rarely or never accessed, so there no performance impact at all.  When you delete files from your machine, fragmentation does not fall within the decision-making process. If you don't remove them if they are not fragmented, then you should not remove them, period.  If you mind really that a file is fragmented after you run a standard defragmentation, there are programs out there as freeware "Contig" that defragment almost anything.

    Contig: http://technet.microsoft.com/en-us/sysinternals/bb897428>

    HTH,
    JW

  • How can I know which servers I have on my network?

    How can I know which servers I have

    original title: how will I know whT I SERVERS

    Hello

    If you use Windows Mail to read this information

    Windows Live Mail, Outlook require similar information

    you need to configure your e-mail account windows mail with your ISP internet service provider

    They provide you with account settings you need to do

    Ask them to

    username
    password for your access broadband account / distance with them

    Server of incoming POP3 mail
    outgoing mail SMTP server

    and here's how to configure windows mail after getting the email correct account settings

    http://www.vista4beginners.com/Windows-Mail

  • In Task Manager, how can I know which processes are running in the background?

    In Task Manager, how can I know which processes are running in the background?

    Hello.

    What exactly is your problem?

    Details please! Thank you.

    • When you open the Task Manager, go to processes
    • under the seat of tab CPU reading 01, 02, or higher... that's how you know what programs are underway on the bottom.

    Helped?

  • How can I combine unique pages in Adobe documents?

    How can I combine unique pages in Adobe documents?

    Hi zebideeplus,

    The help of the player, you must purchase a subscription for the Pack of PDF from Adobe combine PDF files into single document.

    Reference: Acrobat.com help | Adobe PDF Pack FAQ

    But if you combine unique pages, so it can be done only with Adobe Acrobat.

    Let me know if you have other queries.

    Kind regards

    Ana Maria

  • How can I change a page of my document from portrait to landscape without changing all the pages

    Acrobat Reader DC - How can I change a page of my document from portrait to landscape without changing all the pages?

    Hello Tracy,.

    You must use Acrobat Pro DC to do it with the help of the Pages organize the toolset.

    Thank you

    Abhishek

  • For a picture given where/how can I know a) file size, keywords) b are associated?

    Hello

    For a picture given where/how can I know a) file size, keywords) b are associated?

    Thank you very much

    Raphael

    Hi Raphael

    For any thumbnail, you can see the pixel dimensions displayed. Click on the image below. Choose your preferences by going to the menu:

    View > View Options

    If you have the keywording Panel open on the right you can see the keywords for any selected image.

  • How can I extract some pages from my document and save it as another file?

    How can I extract some pages from my document and save it as another file?

    You will need Adobe Acrobat to do that, not Adobe Reader.

  • I have two videos that I would like to combine. But the audio part of the second video is delayed, how can I change so that audio and Visual are equal. IM using windows live movie maker. Thank you

    I have two videos that I would like to combine. But the audio part of the second video is delayed, how can I change so that audio and Visual are equal. IM using windows live movie maker. Thank you

    Hello hodginswill,

    Thank you for visiting the website of Microsoft Windows Vista Community. The question you have posted is related to Movie Maker and would be better suited to the Windows Live community. Please visit the link below to find a community that will support what ask you:

    https://windowslivehelp.com/product.aspx?ProductID=5

  • When I turn my library of music in format mp3. I have duplicates.how can I know which songs are mp3

    I have a mp3 player.i sansa player - tunes doesn't recognize Sansa, so I need to transfer my music in windows media player. to do this I need to convert all my music in mp3 format.when I do that, then I can burn all my music and import to wmp.question is that when I convert to format mp3, how will I know which songs are mp3?

    You can create a smart playlist which, for example, collecting files converted based on the date that they are added to the library. It depends on how you want to proceed. If you want to permanently convert, I have a script called ConvertFormat which range the originals after conversion. Alternatively, you can temporarily change your media to the converted files folder are stored in a folder of new media, then once the process is complete you may add these files to your WMP library, reset the media in iTunes folder and delete the new additions to iTunes library, thus separating the two libraries.

    TT2

  • How can I know which files are accessed more so I can move them to another drive

    My C drive is constantly busy and is indexed to 100% much of the time.  My swap file is on my S drive and its activity is very low. How can I know what is causing all the readers of the activity on my C drive so I can move some things my S, or other?

    I realize it is not easier to simply move the files, I might have to reinstall some applications or other things. But for now, I don't know what are the files or applications, roll to the top of the activity on my C drive.

    You can use performance monitor. Type perfmon in the "Search" box and press "Enter."

    Open the drive section by clicking on the arrow

    To identify individual files in more detail, you will need the Windows Performance Toolkit

    http://msdn.Microsoft.com/en-us/performance/cc709422

    http://msdn.Microsoft.com/en-us/performance/cc825801

    Download as part of the WIndows SDK from here:

    http://www.Microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyId=6b6c21d2-2006-4AFA-9702-529fa782d63b

    Select this option for components you need.

    There is a video on the use of the tool here: http://channel9.msdn.com/Events/PDC/PDC09/CL16

    At a glance, use Process Explorer to identify the source of the e/s:

    http://TechNet.Microsoft.com/en-us/Sysinternals/bb896653

    On the file menu, click "show details for all processes."

    On the view menu, click on "Select columns" and check the deltas of reading and writing.

    You can also use the process monitor:

    http://TechNet.Microsoft.com/en-us/Sysinternals/bb896645

    This will show you the operations of individual files so the amount of data will be huge. If a Visual inspection reveals anything, you can export the data to a csv file and use a spreadsheet to a total activity for each file.

  • How can I know which edition of firefox I have on my computer?

    I need to know how to know which version of firefox I have on my computer.

    You run Firefox 3.6.24 - you can find the version by going to the Help Menu by clicking on "about Mozilla Firefox" or by going to about: support

Maybe you are looking for