[CS3][JS] Return first page for story

I'm bogged down trying to find a simple way to return the number of
the first page that a particular story appears on, assuming that it
is placed on a page and not all overset. Or the number of the page
that the first word in the story appears on, or something like that.
Can anyone help a beginner?
Noel

> myStory.textContainers[0].parent.name
This will not work if the frame is in a group (which most of the time is not the case, so it probably doesn't matter). But just in case, the following method will reliably find the correct page, but is not necessarily the most efficient, depending on the number of pages in the document.
>var myFrame = myStory.textContainers[0];
var myPage = GetPageOfFrame(myFrame);
var myPageName = myPage.name; // the page's folio, a string
var myPageOffset = myPage.documentOffset; // the nth page of the document, a number
function GetPageOfFrame(theFrame)
]for (var p = 0; p < app.documents[0].pages.count(); pi++)
]]var myPageItems = app.documents[0].pages[p].allPageItems;
for (var pi = 0; pi < myPageItems.length; p++)
]]]if (myPageItems[pi] == myFrame)
]]]]return app.documents[0].pages[p];
There's a another method to deal with frames in a group (or group of groups), which involves a recursive handler to keep looking at the parent of the parent, etc, but the one I use is flawed in certain circumstances so I use this one when reliability is important.

Similar Messages

  • "returning error page for JRun too busy or out of memory"

    Hello,
    I've got some trouble to update a ColdFusion linux based.
    We have already tried to update from ASPB11-04 and ASPB11-14 but we always have the folloing erreor message :
    "returning error page for JRun too busy or out of memory"
    We really need a solution ASAP. Thanks!
    Jeff

    Can you share the exception and application logs having the error entries.
    Regards,
    Anit Kumar

  • Soft returns in Pages for iPad

    I would really like to create a space between numbered items in Pages but I can't figure out how to do it.  Does anyone know how to create a soft return in Pages for iPad?
    I have seen responses for the desktop application but not the iPad application.

    Pages 1.7.1, IOS 5.1.1
    You start a bullet item and then press both ⇧ and return keypad keys to force a newline. This turns off the bullet style. Press return. Use the paintbrush toolbar icon to reselect the Bullet paragraph style again. This approach shows the inelegant possibility.
    The best approach would be at the end of your bullet text, change your line spacing from 1.0 to 1.25 from within the paintbrush > Layout tab. A return continues your bullet style. If your normal body text has been 1.0 line spacing, you can switch back to that after your list.

  • Creating a soft return in Pages for iPad

    I would really like to create a space between numbered items in Pages but I can't figure out how to do it.  Does anyone know how to create a soft return in Pages for iPad.

    daisybrain2663 wrote:
    Why isn't that in the help topics for Pages?  Frustrating.
    I guess that we could ask that question about a few different things Apple related.
    I'm glad that you got the hang of it.

  • Only the first page for a particular site prints. All other sites are fine.

    I'm running Firefox 10.0.2 on Windows 7 SP1 and when I try to print the web page of the affected URL ( http://windows.microsoft.com/en-US/windows-vista/Connect-to-another-computer-using-Remote-Desktop-Connection ), only the first page is printed. It prints fine in IE 9. I tried printing in safe mode and it still only prints the first page. I only tried printing it once, after that I used print preview alone. I used print preview on a dozen other sites and it works fine. By the way, on the web page I'm trying to print you must "Show All" at the bottom to expand all of the text. It's just this one web page. Can someone else with a similar setup try print preview on this page for me? I just want to know. I printed it using IE. Interestingly, if you scale the print preview down enough, all of the text shows up. Thanks...

    Well, I've made a little progress. I saved the web page source locally and then added the following HTML snippet to the <head> section:
    <style type="text/css">
    div
    page-break-before:always;
    </style>
    When I display this, the "Show all" does not work, but the page text is still long enough to do "Print Preview" and expect more than one page. The result is a blank first page (expected) and then ALL of the page text is printed on the next two pages.
    But I think you are correct "the-edmeister" in saying that Firefox may have a problem when the DIV tag spans more than one page. The reason is that the third page only contains the footer, so I can't say for sure if the whole DIV block was printed. But at least the footer did show up this time.
    If I can get the "Show all" block to expand then maybe that question will be answered. Any thoughts?

  • Creating a new first page for HAP_PDF_OFFLINE_FORM

    I've copied this to a z version and am trying to create a new first page. I've created a new subform and it prints correctly before the original information but I need the original info to start on the next page. Any help is appreciated, thanks.

    Mark subform which you want to move to next page, check tab Pagination (next to Layout, Object etc.), set "top of next page".
    Otto

  • AS CS3 go to first page

    Still a newbie to applescript. I'm just trying to get the document to go to the first page.  What's the syntax/codescript I need?
    Here's my chunk from my bigger script:
    try
    tell layout window 1 of MyDoc
    go to first page
    end tell
    end try

    You're right -- this is a case where using tell causes problems. You can use this form:
      set active page of layout window 1 of document 1 to page 3 of document 1
    Otherwise you nedd to use a reference:
    set thePage to page 3 of document 1
    tell layout window 1 of document 1
    set active page to thePage
    end tell

  • Default "First" Page for each Folder

    Following on from Rick's note if I may...
    Similar question: My file contains numerous folders, the
    inital one of each has a page with a "departmental - overview".
    What I have for each Folder - eg. Finance - is a page
    containing this "overview" - like a "title" page, below this are
    the sub-folders for each aspect of that Dept. eg Job Descriptions,
    Processes ....
    So - when you create the TOC, is there a way that you can get
    the "overview" listed first, and under that, the sub-folders,
    rather than this overview being detailed below the folders....
    Does this make sense???
    Al

    By folder, it sounds like you mean Book in the TOC. Right
    click the book and link it to any topic.
    If you also created a printed output, by default you will get
    the topic twice, once with the book and once in its own right.

  • Pages for iPad--different first page

    I haven't been able to find a way in Pages for iPad to create a different first page for headers and footers. Is it possible?

    So I'm really glad I found this conversation and I think I can help at least to find a temporary solution until Apple fixes this issue with pages for iPad.  I had the same question and it seems that, in general, those of us that are upset with the lack of this feature are trying to abide by the APA guidelines for running headers.  What I did is I went onto pages on my iMac desktop and created a template document with the headers set up in APA format.  From there I retrieved the document on the iPad through dropbox (or icloud) and the change was made.  Now, everytime I go to write something in APA on pages for the iPad I start with this template and I don't have to worry about setting up the headers as they are ready to go. I am recommending this because not only does it serve as an easy starting point for writer's in APA fields, it also guarantees that an authors work is consistent in its formating and style.  No longer will you have to struggle with the subtle nuances of document design.  Just make a template!
    -B

  • How do I print the first page of numerous documents?

    Computer setup:
    Adobe Acrobat Pro 9.10 on Windows XP Professional x64 Edition.
    User experience:
    I consider myself proficient in office (Excel, Word) and software use in general (Windows XP). The extent of my Adobe Acrobat experience is creating custom dynamic stamps. I have little to no javascript programming knowledge.
    Problem:
    Numerous pdf files in multiple directory locations must have the first page of each document printed.
    Current (and time-consuming) solution:
    Copy the files to a single directory
    Use Acrobat Pro to combine files and individually select the first page for each document
    Combine and print.
    Tools
    Filename Extractor (can be used to extract the filename OR filename and path of documents)
    Bonus Points
    An index of all documents exists in Excel format. Documents are selected for printing by filtering this Excel index. The Excel index will have a column containing the path of each document. A solution that can utilise this path information to shortcut the time-consuming "copy and paste" method currently used will attract bonus points.
    Thanks in advance,
    Simon

    Create a batch process the executes the following JavaScript code:
    this.print({nStart:0, bUI: false, bSilent: true});
    It will silently print the first page of any file you batch. Be careful not to overload your printer's queue by sending too many files in one go.

  • "Open Link in New Tab" doesn't remember first page in history

    I recently noticed that the "Open Link in New Tab" is not remembering the very first page in the tab history. The replication is simple.
    # Go to any page (Google works well)
    # Right click and chose to open a link on the page in a new tab
    # On the new tab, left click a link to load a new page
    # The "Go back one page" button will remain grey and you will not be able to go back to the first page for the tab.
    # Left click another link and the "Go back one page" button will now be active allowing you to go to the previous page, but not all the way back to the first page of the tab.
    This happens whether I use the middle mouse or a right click and chose open in new tab. It is present since I upgraded to Firefox 4.0, but was also happening before the upgrade when I was using Firefox 3.6.

    I have the same problem. There are two other problems that might be related. The first one is, sometimes it seems like Firefox loses focus of the page so if I try to refresh the page using CTRL-R or the refresh button, nothing happens. The only way to refresh the page is to hit CTRL-L and Enter as it you're opening the page again. The second problem happens when another window is opened (e.g. new window, new bookmark window from CTRL-SHIFT-B). When you go back to the original window, everytime you go to the tab that the new window was opened from, somehow Firefox brings the window to the front, but the focus is still on the tab.

  • Dynamic first page - newbie question

    Here is the setup,
    My application is invoked from a third party (single sign-on) where the request contains a verified user id. The request will ask for the default index.jsp which will then be forwarded to a faces page.
    I have a backingBean userBean in session scope. In its initialization, it will read the user profile from the databse and find the default first page for a user.
    Is there anyway I can do in the index.jsp to forward to different default first page for different users?
    I'm coming from the servlet background and I know it can easily be done from a servlet (dispatch to different pages after reading the user info). I just don't know how to accomplish that with jsf. I guess if anywhere I reference #{userBean} in faces jsp, the userBean initialization will be executed so I know who the user is. But I don't know if there is anyway I can re-direct a dynamic page based on a property in userBean.
    Thanks in advance.

    After reading user profile in your userBean
    execute this code:
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    externalContext.redirect(externalContext                         .encodeResourceURL(externalContext                                        .getRequestContextPath()+ userPage));
    userPage is a full path to jsp page.
    Hope it helps.
    Martin

  • Display first page , 3rd page & consecutive pages / Display 2nd page....

    Hi Friends
    We have a requirement to display first page, 3rd page & consecutive pages (dont display 2nd page) for a sales order particular to a plant in smartforms.
    Similarly, display 2nd page, 3rd page & consecutive pages (dont display first page) for a sales order particular to different plant in smartforms.
    Kindly provide your valuable inputs
    Thanks
    Lavanya

    Hi,
    Write this code in Initilization.
    constants:c_fir(5)  type c value 'FIRST'',
                     c_sec(6)  type c value 'SECOND'.
    DATA:L_NAME(17)   TYPE C VALUE '%HEADER-FIRSTPAGE'.
    FIELD-SYMBOLS: <FIELD>.
    IF werks  <> '1000'.
      ASSIGN (L_NAME) TO <FIELD>.
      IF SY-SUBRC EQ 0.
        <FIELD> = C_SEC.
      ENDIF.
    ELSEIF werks  <> '1010'.
      ASSIGN (L_NAME) TO <FIELD>.
      IF SY-SUBRC EQ 0.
        <FIELD> = C_FIR.
      ENDIF.
    ENDIF.
    By this code you can set the first page. Then to call the disired page in these pages create a command node in main window of each page and select the check box go to page select  third page in drop down .
    Thanks,
    Nethaji.
    Edited by: Nethaji babu on Jul 17, 2009 1:11 PM

  • Different first page

    I should have different first page for different users. How can i redirect after login and authentication (this is custom authentication method) ? My environment is HTMLDB 6, 10G and Windows.

    What you want can be done by inserting a Layout
    Break, and then changing the settings appropriately
    in the Layout Inspector. If you need to do this on a
    regular basis, you might want to look at the Pages
    documentation on how to set up a template.
    I faced a similar problem, but found a somewhat different solution. I was formatting a letter that required a different TOP margin for the first page because of letterhead. (Second and subsequent pages required a smaller TOP margin.) Here's what I did:
    First, I set the MARGINS of the entire document in accordance with the requirements for the second and subsequent pages. Then, rather than inserting a layout break, I inserted a SECTION BREAK at the end of the first page. I then opened the LAYOUT INSPECTOR and selected the LAYOUT button. Then, I set the LAYOUT MARGINS-BEFORE for the first section to 2.5, which was the margin size I needed on the first page.
    iMac   Mac OS X (10.4.8)   Dual Core Processor
    iMac   Mac OS X (10.4.8)   Dual Core Processor

  • TS3276 Hello. When trying to forward a multiple page PDF document, only the first page appears. Does anyone know how to fix this. TY

    Hello. When trying to forward a multiple page PDF document, only the first page appears. Does anyone know how to fix this. TY

    Are you sure?   I believe the mail program only previews the first page for you, but sends the whole attachment.  Try opening the attachment (e.g., select and hit spacebar for a preview of the whole thing, or by double-clicking it, or control-clicking then "Open...")  You should see the whole document.

Maybe you are looking for