Get current page or page of selected item

Hello,
I' d like get the current page in Indesign or (if this is not possible) the page of a selected object.
How could I implement this?
var page = app.selection[0].page;
does not work.
Thanks and kind regards,
mannyk

Another way getting that done is based upon what is your current
selection.
                var myPg=getPage(app.selection[0]);
                alert (myPg.name);
function getPage(theObj)
if (theObj.constructor.name == "Page") return theObj;
if (theObj.constructor.name == "Character" || theObj.constructor.name ==
"Paragraph")
return getPage(theObj.parentTextFrames[0]);
if (theObj.constructor.name == "Application")
// Frame is on an unexpected place...
alert ("Can't able to find the page");
exit(0);
return getPage(theObj.parent);

Similar Messages

  • Can I extract the page number of the selection item

    Hi,
    I want to extract the page number of the selected item in my document
    Is it possible?
    my script will be executed out from InDesign by another application
    please help me

    Yes, that's right! I read it so wrong!
    In CS5 there is new property:
    var mySel = app.selection[0];
    var mySelPage = mySel.parentPage;
    alert(mySelPage);
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/
    http://inditip.wordpress.com/

  • How to get current application and page references

    Hi,
    I have buttons (to print and download in PDF, CSV, XLS) on several pages... at the moment I am using following code to get them working...
    http://apex.oracle.com/pls/apex/f?p=31815:3:&SESSION.:PDF
    which means that on every page I need to put the reference in hard coding... is there a way to replace page number and application ID with a reference (similar to what I've done above to the session ID)... something like this
    http://apex.oracle.com/pls/apex/f?p=REF_APP_ID:REF_PAGE_ID:&SESSION.:PDF
    Thanks

    Hi,
    Use substitution strings. And you do not need write whole URL
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#sthref156
    f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.:PDFRegards,
    Jari

  • Get current path of page

    I'm making use of the Facebook Like function and for it to work properly I need to enter the URL of the current page being displayed. I tried using:
    <!--$ssGetServerRelativeUrl(nodeId, siteId)-->
    that I found from a different post, but nothing is showing up on the page. Any suggestions?
    In advance, thanks!
    Edited by: Trevor B on Aug 17, 2010 10:27 AM
    Edited by: Trevor B on Aug 17, 2010 10:28 AM

    Oh....well in that case you will need to do something like this:
    http://[!--$SERVER_NAME--]/[!--$ssGetServerRelativeUrl(siteId,nodeId)--][!--$if isSecondaryPage eq 1--][!--$region1--][!--$endif--]
    region1 would be the region for the main content, you may have renamed it to something else.
    There is another way to do this which I think would be easier, if you append ?IsJava=1 to the end of the URL you will see a page that will display the local data properties.
    One of the variables you want to look for is *'siteRelativeUrl'* if you use this there will be no need to check if the page you are on is a secondary page.
    It would look something like this:
    http://[!--$SERVER_NAME--][!--$siteRelativeUrl--]

  • Get artboard of selected item

    I have script where I select items on multiple artboard but I can't seem to get get active art board of the selected item. Is this possible?
    each artboard has a text item and I would like them in the same position on each of their own artboards that they are already one. right now it adjusts them all to one artboard. here is what I have so far
    doc = app.activeDocument;
    for(i = 0; i < selection.length; i++){
        var firstItemPosition = doc.selection[0].position;
        doc.selection[i].position = firstItemPosition;
        var activeArtboardIndex = doc.artboards.getActiveArtboardIndex();
        alert(activeArtboardIndex);

    hmm it seems it doesn't work the way that I thought it might. It still always positions items based on first artboard even when you set: 
    idoc.artboards.setActiveArtboardIndex(i)
    I tried to implement it like this, any idea what I might be doing wrong?
    // return each selected item's artboard index
    // carlos canto 09/28/2013
    // http://forums.adobe.com/message/5721205?tstart=0#5721205
    var idoc = app.activeDocument;
    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    var selec = idoc.selection;
    var firstItemPosition = selec[0].position;
    var sel = [];
    for(i = 0; i < selec.length; i++)
        sel.push(selec[i]);
    for(j = 0; j < sel.length; j++) {
        idoc.selection = null;
        alert('selection ' + j + objectArboardIindex (sel[j]));
    for(j = 0; j < sel.length; j++)
        sel[j].selected = true;
    app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
    function objectArboardIindex (obj) {
        var idoc = app.activeDocument;
        for(i=0; i<idoc.artboards.length; i++) {
            idoc.artboards.setActiveArtboardIndex(i); // activate each artboard
            idoc.selectObjectsOnActiveArtboard(); // select all in artboard
            if (obj.selected) {
                obj.position = firstItemPosition;
                return ' is in Artboard ' + idoc.artboards.getActiveArtboardIndex();
            idoc.selection = null;
        return ' is outside artboard(s)';

  • Query a table using Multi Select Item

    Hi everyone!
    I got a page where I have this multiselect item, and I want to query a table using its values.
    For example: The Multiselect item has this values: 1,2,3,4,5,6,7,8,9 and 10
    And I want to query every person who has ID_CLASS 1,4,7 and 9 by selecting those IDs from the list, and when I click que Consult button the Report displays those persons.
    Whowever I can't accomplish this, I was trying to find a post about this without success.
    Can anybody help me with this?
    Thanks!!

    Hi,
    This is my problem, I select 2 or more options in the multiple select item, then after I click the "Consult" buttom it submits the page, however only 1 option is highlighted. For example I choose the first two options, then I click Consult and the page is submitted. After that only one of the 2 options are selected, but I need to get the 2 options highlighted as selected items.
    If I clear cache I think I'll lost everything. (selected items)
    Thanks again!

  • Solaris 10 11/06 - grub Error 28: Selected item cannot fit into memory

    I don't get install Solaris 10 11/06 in my IBM Thinkpad 600X laptop with 584 MB RAM memory.
    When I try I get allways this message:
    Error 28: Selected item cannot fit into memory.
    I have seen similars topics in this forum but nobody has found a right solution.
    Any idea to help me?
    Thanks.

    I was testing my memory with memtest86 for three hours and I didn't find any problem.
    I think my memory is working fine.
    Thanks for your reply anyway

  • Shuttle: How to reference selected items on the right side

    This seems so easy so why am I struggling so much.
    I have a simple shuttle:
    1 Adam
    2 Baker
    3 Charlie
    4 Delta
    5 Echo
    6 Foxtrot
    Select Name D, UserID R from UserTable
    The values are stored in a VARCHAR2 field MULTI_USER (for example 1:2:4:6)
    When I want to get the names back from the selected item, how do I reference the colon-separated items?
    For example:
    Select Name from UserTable
    where UserID in (select MULTI_USER from MULTI_USER where MULTI_USER_ID = 1)
    should return:
    Adam
    Baker
    Delta
    Foxtrot
    Why is this so difficult for me to figure out?
    Thank you in advance

    Hi,
    This might help
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_item.htm#sthref908
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • How do i get current active or selected page item's  reference

    Hi all,
    How do i get current active or selected page item's  reference .
    Please help me

    You can implement a selection suite for your need, this selection suite will be placed into the kLayoutSuiteBoss.
    In this selection suite place a method to give you the UIDRef of the selected pageitem, which you can get by using the method "GetUIDList" of the "ILayoutTarget" interface.
    Manan Joshi
    - Efficient InDesign Solutions -
    MetaDesign Solutions
    http://metadesignsolutions.com/services/indesign-development.php

  • How to get  selected item page number?

    I am developing the plug-in for moving page item from one page to another page,for that i need selected item page number.i.e. i need the page number
    which the item is selected.

    Just access the 'currentCountry' property in the action method.
    public void submit() {
        System.out.println("JSF has already set the property: " + currentCountry);
        // Now do your thing with it. E.g. saving it or so.
        countryDAO.save(currentCountry);
    }

  • Export selected items on each page in InDesign to JPEG

    Hi All,
    I have InDesign CS5.5. I have a document with more than 50 pages and each page has unique image and the description for image.
    I need to export each page as JPEG. but i don't want to export full page. i need only the items on each page. So i go to each page and select all the items and export. while exporting i use the same name of the image used in each page.
    I tried writing a script but it exports only the active page. i do not know how to navigate to the next page and export.
    is some one can help.
    below is my script.
    var myDoc = app.activeDocument;
    var myNumPages = myDoc.pages.length;  //get the number of pages
    var myFilePath = myDoc.filePath; //get the file path
    var myRectangle = app.activeWindow.activePage.allGraphics; //get the graphics of the active page
    var myPageName = app.activeWindow.activePage.name; //get the page name.
               if(myRectangle.length >1)
                        alert("the page has more than one image. Delete the other image to export");
                        exit();
    var myImageName = myRectangle[0].itemLink.name; //get the name of the image
    app.select(NothingEnum.NOTHING);
    for(var i=0; i<myNumPages; i++)
              app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
              app.jpegExportPreferences.exportResolution = 300;
              app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
              app.jpegExportPreferences.pageString = myPageName;
              mySelectedItems();
    function mySelectedItems()
              var myObj = new Array;
              myObj = app.activeWindow.activePage.pageItems; 
              try
                                  app.activeWindow.activePage.groups.add(myObj);
                                  catch(e)
              app.select(app.activeWindow.activePage.allPageItems);
              app.selection[0].exportFile(ExportFormat.JPG, File(myFilePath+"/"+myImageName+".JPEG"), false);

    export all image of each page try like this
    var myDoc = app.activeDocument;
    var myFolder = myDoc.filePath;
    var myImage = myDoc.allGraphics;
    for (var i=0; myImage.length>i; i++){
        app.select(myImage[i]);
        var MyImageNmae  = myImage[i].itemLink.name;
        app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
        app.jpegExportPreferences.exportResolution = 300;
           app.selection[0].exportFile(ExportFormat.JPG, File(myFolder+"/"+MyImageNmae+".JPEG"), false);
        alert(myImage[i].itemLink.name)

  • Getting the number of pages in excel sheet or current page using OLE2

    Hi,
    I fill an excel sheet using CLIENT_OLE2 from Oracle 10g form,
    I want to get the number of pages in sheet or the number of current page,
    after searching for solution I found this example on VB:
    Sub GetPageCount()
    Dim iView As Integer
    Dim iHorizontalBreaks As Integer
    Dim iVerticalBreaks As Integer
    Dim iPageCount As Integer
    On Error Resume Next
    'go to the range and set PrintArea to the range name
    Application.Goto Reference:="ABC"
    ActiveSheet.PageSetup.PrintArea = Selection.Address
    'turn monitor flickering/updating off
    Application.ScreenUpdating = False
    'remember current View setting
    iView = Application.ActiveWindow.View
    'refresh the print area
    Application.ActiveWindow.View = xlPageBreakPreview
    'set view back
    Application.ActiveWindow.View = xlNormalView
    'turn monitor flickering/updating back on
    Application.ScreenUpdating = True
    'calculate the # of pages
    iHorizontalBreaks = ActiveSheet.HPageBreaks.Count + 1
    iVerticalBreaks = ActiveSheet.VPageBreaks.Count + 1
    iPageCount = iHorizontalBreaks * iVerticalBreaks
    How can I implement this using CLIENT_OLE2?
    Any assistance would be welcome.
    Thanks

    IF all the panels were exactly the same width (highly doubtful for a roll-fold) and IF ID supported 12 pages per spread (it doesn't) then it might be less work to make 12-page spreads and place the PDF twice, but since I think there's a really good chance you'll need to adjust the positioning for at least 22 pages, that seems doomed.
    I wouldn't even bother, in this case, with facing pages. Presumably they want this for the screen, so there's nothing gained from facing pages or multiple columns. You can either make the file with 24 pages and place the PDF 12 times for each page of the PDF, or place each page of the PDF once in a 2-page file, then copy the pages and reposition the image in the frame for each panel. The big thing here is to put the PDF into frames that are the same size as the new page (so they get cropped down to one-panel on each page). Then it's just a case of sliding the the PDF left or right in the frame to expose the next panel.

  • Get current page title sandbox solution

    Hi
    What is the best way to get current page title in sandbox visual web part code behind?
    I observed SPContext.Current.Item is not defined so I cannot use SPContext.Current.Item["Title"].
    I get title and sate creation page...
    Thanks

    Hi,
    I suggest you follow this blog to build a new sandboxed solution for a test to see if it will work in your environment:
    http://social.technet.microsoft.com/Forums/en-US/988c573f-1caa-42ea-b55a-740627bc351f/get-current-page-title-sandbox-solution?forum=sharepointdevelopm
    Feel free to reply with the test result.
    Best regards
    Patrick Liang
    TechNet Community Support

  • IS-U print workbench - User exit - to get current page number

    Hi,
    I have a doubt in IS-U print workbench where in I need to get the current page number which is being processed inside the user exit of the application form.
    I have a user exit called Z_EXIT_150 and here I have a subroutine which is inside the LOOP DOC_ITEM …ENDLOOP.
    Inside the subroutine, I need to get the current script page number.
    There is an option of getting the current page as &PAGE& inside the Script but I need to know the page number inside the exit.
    Do you have any idea of getting the current page number?
    Thanks and Regards,
    Sakthi.

    Hi Sakthi,
    I have also had this problem while working in IS-U Print Workbench but was also unable to solve.  I tried looking into the output_text that is called when reaching an object that references SAPSCRIPT-FORMPAGES but I too could not find a way to save PAGE to a variable for later use.
    The only idea I can think of, although I have not tried, would be to place some sort of counter variable in the BUILD_DOCUMENTS and increment the counter each time there is a successful printout of a header logo or some other object that you expect to see printed on each new page - that way maybe you can determine later in the exit processing what page # you are currently in. 
    I hope this has helped some.  I would be really interested to hear if someone else has a solution of how to access items in the SAPSCRIPT structure from outside of the SAPscript code.
    Regards,
    Geoff

  • How do I get to the start page when I'm not on it currently? there used to be a buttom for it

    I recently updated to version 6.0.2 of Firefox. This version doesn't seem to have a "home page" button. How do I get to the home page when I'm currently not on it? I shouldn't have to press the "backpage" button until I get there or type it in to get there.

    You can find the toolbar Home button at the far right end of the Navigation Toolbar.
    You can drag the Home button from its current position at the right to the previous position at the left of the location bar if you do not like that new position.
    * http://kb.mozillazine.org/Toolbar_customization

  • How to get Current Page(region)  Name/ID   in OA 11i

    We need to get the name or id of the current page, and based on the pagename, we retrieve configuration to launch specific web service.
    pageContext.getPageLayoutBean().getPageFunctionName() is no sufficient. Since one page function sometimes contain multiple pages (eg, each individual page maps to one train node, all the train nods maps to one page function).
    are there OA apis that I can use to get the Current Page name in controller?
    I tried pageContext.getParameter("CurrrentPage") , it works great for iExpense application. However, in iRrecuiment, the parameter "CurrentPage" was not set at all.
    Please advise.

    First let me explain what I want to achieve:
    I am writing one region (choice list displays the webservices based on the container region) along with the controller, and that region will be embed inside any OA application pages via OA personalization. On the runtime, I need to detect the current page (container region) name. Then, based on the configuration stored in my table, I need to query out the web services endpoint to call.
    Now let me answer your question:
    For example, OIEMAINPAGE.xml (OIEMainPageContainer) contains OIEReview, OIEDetail, OIEGeneral, etc, each inner region will be rendered as a page when you click the train node or link of other page. (from end user perspective)
    If I call pageContext.getPageLayoutBean().getPageFunctionName() on those inner regions, it will return OIEMAINPAGE, so I can not figure out which region are rendered (displayed) on runtime. (My region are embed inside OIEMAINPAGE pagelayout region )
    If I call pageContext.getParameter("CurrrentPage"), it will return (OIERview, OIEDetail etc), which are exactly what I want.
    However, I have to make sure my code works for other OA application, and I already noticed that some application does not set parameter CurrentPage, instead they may set parameter Page. So, I want to know if there is API provided by OA or fnd team to return current container region (page), very similar to Form Block name.
    In form, One Form function could have multiple Blocks, and they are not displayed at same time.
    In OA, one function could have multiple inner container region, and they are not displayed at same time.
    In form, One Form function could have mutlple Blocks, and they are not displayed at same time.
    In OA, one funciton could have mulple container region, and they are not displayed at same time.

Maybe you are looking for

  • How can I embed a HTML document onto my webpage?

    What I am trying to do: I am trying to make an image that has links to urls from different parts of the image. What I have done so far: I have built a photoshop image to embed on my webpage, following the instructions offered by many online forums, b

  • Change form in report painter KE80

    Hi, Easy question maybe but I can't find the solution... How is that possible to change the report of the form I have created in KE85 ? I have used a standard report and I would like to use another one for my form. Thanks in advance for your help, Ro

  • Duplicate handling Not Working

    Hi PI EXperts, I need your help here. I am using the option of Duplicate handling in sender FTP channel as below: Enabled Duplicate handling: Yes, Duplicate message alert threshold:0. But I found few duplicate files are processed and archived twice?

  • How to identify non-placed Photos in Aperture3

    Today i switched to Aperture 3. In the past i've used a "intelligent album" to identify photos that do not carry GPS information. This task was pretty easy because any photo with valid GPS coordinates got an additional tag also (using Maperture). The

  • Change the decimal places in screen MIGO field Order quantity - MENGE

    Gurus       the scenario is in Screen MIGO , when gettin inside posting MIGO the functinal consultants need to give order quantity in the second screen and the technical name of that field is MENGE which can accept only 2 decimal places after point..