Auto master page application

I wrote this script to see if I could hook master pages to a paragraph style and I have a couple of questions.
1. Currently I'm using the "onIdle" event type is there a better event type that could be used that would still run without interrupting the user?
I was thinking the "afterAttributeChanged" event type might work better. When is this one called? Is it called for every attribute change in the layout window?
2. I'm also searching for the pages that I want to change via grep and grabbing the page with paragraphs[i].parentTextFrames[0].parentPage;
Is this the most efficient way to do this?
Here's what I have so far:
#targetengine "session"
var doc = app.activeDocument;
var chapterStyleGroup = doc.paragraphStyleGroups.itemByName("Chapter");
var chapterTitle = chapterStyleGroup.paragraphStyles.itemByName("ChapterTitle");
var aMaster = doc.masterSpreads.itemByName("A-Master");
var cMaster = doc.masterSpreads.itemByName("C-Chapter Open");
var chapterPages = [];
app.findGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.appliedParagraphStyle = chapterTitle;
var paras = app.findGrep();
for (var i=0, l=paras.length; i<l; i++) {
          var parentPage = paras[i].parentTextFrames[0].parentPage;
          chapterPages.push(parentPage);
          parentPage.appliedMaster = cMaster;
var listenerTask = app.idleTasks.add({sleep: 5000});
listenerTask.addEventListener("onIdle", checkPages);
function checkPages() {
          var savedPrefs = app.findGrepPreferences.properties;
          app.findGrepPreferences = NothingEnum.nothing;
          app.findGrepPreferences.appliedParagraphStyle = chapterTitle;
          var paras = app.findGrep();
          for (var i=0, l=paras.length; i<l; i++) {
                    var parentPage = paras[i].parentTextFrames[0].parentPage;
                    if (chapterPages[i] !== parentPage) {
                              chapterPages[i].appliedMaster = aMaster;
                              parentPage.appliedMaster = cMaster;
                              chapterPages.splice(i,1,parentPage);
          app.findGrepPreferences.properties = savedPrefs;

Peter, without threading, the individual text boxes on the master page do number correctly. They are empty text boxes except for an invisible character such as a hard return, and once I have the invisible character in place, the numbers appear.
Because 1-6 already number and appear correctly, it doesn't make sense to me to thread them together, although I did try it including from caption 6 back to caption 1...this resulted in caption 1 disappearing and all the other captions reducing by increments of one (1-5).
I'm not sure if I'm 'placing' my list incorrectly (that term doesn't quite make sense to me ~ I thought you define a list and then apply it directly or through a paragraph style?) or what, but do you have any other suggestions?

Similar Messages

  • Master pages failing to be applied (along with some unexpected behavior)

    Hi all,
    I am having trouble getting our structured app/template to apply master pages properly. We're on Frame 11 using an XDocbook, customized app.
    Here is the configuration:
    1. Reference page structMasterPageMap:
    Maps element E:BookInfo  to the "Title Page" master page. 
    Maps element E:PrefaceInfo to the "Frontmatter" master page.
    2. Frame XML document content:
    <bookinfo>
         <title>
         <edition>
         <copyright>
    </bookinfo>
    As you can see, this doc does not yet have a PrefaceInfo element, although one is allowed by the DTD.  So the obvious solution is to either: 1) add one (wrap the <copyright> element in a <prefaceinfo> element as allowed); or 2) add an "E:Copyright" mapping to the ref page. Yet, neither of these work.  Here's what occurs:
    Solution A: On the Ref page, add a mapping from E:Copyright to the "Frontmatter" master page:
    1. Open the document in Frame and note that the master page Title Page is applied, but the master page Frontmatter is not, as expected.
    2. On the ref page, add the E:Copyright mapping to apply the Frontmatter master page.
    3. Reapply Master Pages, and the Frontmatter page is applied, as expected.  All is good....except.  When you close and then re-open the document, no master pages are applied, not even the Title Page which had previous worked. Huh, what?
    4. Remove the E:Copyright mapping from the ref page, reapply Master Pages, and the Title Page master page is again applied.
    Note: This behavior is reproducible whether I replace the E:PrefaceInfo with E:Copyright on the reference page, or retain both. I can also reproduce this by using the paragraph tag instead, of the element, i.e. P:FrontmatterCopyright.
    Solution B: In the document, add a <prefaceinfo> element:
    1. Open the document in Frame and note that the Title Page master page is applied while the Frontmatter is not, which is expected.
    2. Wrap the <copyright> element in <prefaceinfo>.
    3. Reapply Master Pages.  Nothing happens, i.e. the Frontmatter master page is not applied.
    4. Save, close, and reopen the document.  The Title page is applied, but the Frontmatter is not.
    Yes, I have checked and rechecked that the actual master page names match those entered into the reference pages, including case.  :-)
    Possible conflicts/factors?
    1. Could the structure of the document (as allowed by the DTD) affect master page application? The element <copyright> can exist both inside a <prefaceinfo> and independently under <bookinfo>.  This doesn't seem likely, especially because as a test, I saved the doc as .fm, discarded the structure, updated the ref page to use para tags instead -- and still the master pages are not applied correctly.
    2. Pagination can affect this -- at first we had Format>Page Layout>Pagination set to "Single Sided" so I thought that was why the left-hand Frontmatter was being ignored. But I have ruled that out; the template is now double sided, and Frontmatter is a left page.
    I am stumped!  Thanks in advance for any ideas.
    - Shelley
    Shelley Hoose
    Sr. Docs Developer, Rogue Wave Software

    Is Adobe World Ready Paragraph Composer the default in CS6 or something? Perhaps that must have caused some issue. I still don't know. I can confirm that no one else has touched this particular file, and it was created and edited only in CS6.
    For new basic styles, you recommend aforementioned composer or the old Adobe Paragraph Composer, especially if the work is only in English (UK/India)?
    Thanks for your time.

  • Master Page Mappings

    Hi, fellow FrameMaker enthusiasts.
    My template contains reference pages on which elements are mapped to master pages. When I open an XML file in FrameMaker, FM asks me if I want to apply the master pages to each page in the document. This is tedious and time consuming in a ditamap containing 30 files.
    I thought the mapped master page application would only take place when you select Format > Master Pages > Apply Master Pages. Is this not true? Am I doing something wrong?
    I've consulted the help and several books and found no helpful information.
    Regards,
    Barbara

    Is that the right approach? - yeah sure it is
    I can now see two update rules one is Z update rule for 0PLANT and the other one is the business content.
    Yeah actually there are not two update rules, infact one is update rule and the other is transformation. You can now delete the old update rule(3.x)
    Is it ok to delete to business content one.
    Yeah it is ok. If you dont want to, you can keep the update rule and never use, but whats the use, go ahead and delete it.
    Why do we need to copy the Infosource??
    The old is a 3.x infosource and that IS is being used by the object in the update rules. So you would need to create a new infosource. Even when you create a new infosource you have 2 options, 3.x or a 7.0 one.

  • How to set custom master page for sharepoint application page ?

    Hello,
    I need to apply custom master page for the custom application page I created for login purpose.
    Can anyone please let me know how to apply master page for custom application page ?
    Note : I need to set custom master page for application page at web application level.
    thanks,
    Dipti Chhatrapati

    Hi Dipti,
    You can use the same reference as ASP.NET
    Example
    "<%@ Page Language="C#" masterpagefile="../_catalogs/masterpage/minimal.master" title="teste" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full"
    meta:progid="SharePoint.WebPartPage.Document" %>"
    You can use SharePoint Designer 2010
    http://www.microsoft.com/download/en/details.aspx?id=16573 to make the reference from you aspx page to you custom masterpage.
    When you are editing a aspx page you can go to ribbon "Style" and attach the custom Masterpage.
    André Lage Microsoft SharePoint, CRM Consultant
    Blog:http://aaclage.blogspot.com
    Codeplex:http://spupload.codeplex.com/http://simplecamlsearch.codeplex.com/

  • Formatted master pages don't auto update in multipage indd doc

    Formatted master pages don't auto update in multipage indd doc. When a page is added/removed, folios and rules remain in right page orientation even if they've just become left hand pages, and vice versa. Forced to keep taking the additional steps of applying master to pages which is incredibly annoying/did not use to happen.

    Formatted master pages don't auto update in multipage indd doc. When a page is added/removed, folios and rules remain in right page orientation even if they've just become left hand pages, and vice versa. Forced to keep taking the additional steps of applying master to pages which is incredibly annoying/did not use to happen.

  • Master pages do no display auto page numbering

    This is strange. I set up auto page numbering on the master pages and the document pages display the page numbers correctly. But later on I thought the page numbers were too large so I went to the master pages to change the size and there's nothing. Thinking the page numbers were hidden from view or somehow were white in color (i.e, they were there but weren't being displayed) I chose Select All but still nothing.

    You're a genius. Happy Thanksgiving.

  • CS4 auto page insert: master page frame or not

    In CS4 the preferences for auto page insert allow to turn off 'limit to master pages'.
    However, don't see much difference wether it is on or off. The Help file states that if you do NOT use master text frames, a new textframe should be inserted, one column between the margins.
    Can not get this to work when limit to master pages is off. What am I misreading...?
    (It is funny sometimes: I have 'delete empty pages' checked (it is on). Now make a document 3 pages long. OK, now draw a empty text frame on page one. Do the same on page 2.
    Now connect both text frames: page 2 disappears. This is to be expected but be aware of this.
    Now insert text in the textframe on page one that does not fit totally in this textframe: overset symbol appears.
    Now where is page 2 that was 'auto deleted' and had the threaded text frame?
    Nope, it does NOT appear again!
    I admit I still have to get to grip with this, so what DOES the switch 'limit to master pages' on/off have for effect...)

    Yes, I know. But maybe my point came over the wrong way. If you have auto page delete on, you have three pages and a textframe that spans page 1 and 2, but not yet text in it, and you connect the empty text frames, page 2 will disappear. Now fill page one with overset, page 2 won't do anything because it needs two pages.
    Disable auto page delete and it will work.
    Just wondering why it was designed this way, that's all ;-)

  • PowerShell - how to list all master pages of all sites in web application?

    Hi there,
    Is it possible to list all of the master pages along with the site URLs in my web application? There are thousands of site collections and subsites etc.
    Thanks so much.

    Apologies for formatting, reply on iPad sucks.... Use this example: http://iedaddy.com/2011/11/sharepoint-information-architecture-diagram-using-powershell-and-visio/ But in the powershell for the select, include the MasterURL property so it will write
    it out to the .csv file as well. I assume you are just looking for what are your active master pages per site are....won't report if you've hard coded the values into individual pages as it is just querying site properties.
    ieDaddy
    Blog: http://iedaddy.com
    Twit: @iedaddy

  • How to auto-fill a book using only one master page

    I'm designing a rather simple photo book in Aperture.  I have a master page setup with six 2x3 image boxes per page.  Each image box has a metadata field for caption and for date/time.  I want to select a large number of images and auto-fill the book using only this master page.  As you might guess, its just going to be a presentation of a large number of photographs, scrapbook style, with the caption and time of each image.  Nothing fancy, intentionally.
    Problem is when I tell Aperture to auto-fill the images, if it needs a new page it randomly grabs a master page layout.  I want all pages to use only this specific master page.
    Can this be done?  Adding my own pages and dragging and dropping images by hand will be too cumbersome when a book might have 300+ images in it.

    Problem is when I tell Aperture to auto-fill the images, if it needs a new page it randomly grabs a master page layout.  I want all pages to use only this specific master page.
    Create a new, empty version of your master page and duplicate it as often as you want using the key combination ⌘D. Delete all pages with a layout that you not want.
    When you have enaough empty pages use auto-fill. It will fill the empty pages you just created.
    For example - plenty of pages using the same master layout, auto-filled:

  • Auto-hostep app with custom master page does not allow custom workflows

    This has been troubling us all day. We have a sharepoint 2013 auto-hosted app. We wanted to simply change the site logo of the master page but it was easier said than done. Finally we had to create our own custom master page with our own site logo to overcome
    this issue.
    Now we are trying to add a custom workflow in our app. But the instalment of the app always fail with this message:
    3> CorrelationId: cec727fc-bbf9-4499-ae36-6a7d05f3ae8c
    3> ErrorDetail: There was an error during the operation.
    3> ErrorType: Configuration
    3> ErrorTypeName: Configuration
    3> ExceptionMessage: Operation is not valid due to the current state of the object.
    3> Source: Common
    3> SourceName: Common App Deployment
    After many hours of searching I came across this
    post that sums up the problem to this:
    Do not use the WebTemplate element in the app manifest to designate any of the built-in SharePoint site definition configurations as the app web's site type. We do not support using any of the built-in site definition configurations, other than APP#0, for app webs.
    Thus, if you would like to include your workflow to SharePoint-hosted app, you have to use APP#0 template.
    I am fairly new to the sharepoint 2013 app development and having so many problems just because we wanted to have a different site logo is making us focus out of the important stuff of our app. Isn't there a simple way for us to change the app's site logo
    and add a custom workflow? Has anyone come up with a solution?

    Have you configured SharePoint Workflow Manager in the farm? Not sure if you are familiar with but in SharePoint 2013, there's a new component called Workflow Manager that needs to be configured to use SharePoint 2013 workflow.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com
    I am using SharePoint Online. I have enabled the following site feature:
    Workflows can use app permissions
    Allow workflows to read from and to write to all items in this site.
    just in case but it makes no difference. When I stop using my custom masterpage the app can install just fine and the workflow is working. When the custom masterpage is enabled the app won't install with the workflow. I am required to remove the workflow
    to install the app.

  • How to display page no for different master pages in one adobe form application

    Hi All,
    we have requirement where we need to  display page nos in different master pages in one single adobe form.
    For the First form the page nos should be displayed pgno of total pages and for 2nd form the page no shuld be displayed as pgno of total pg.
    so please help me with any script or suggestions for displaying the page no accordingly in different master pages. Your suggestions are greatly appreciated.
    Thanks
    Raja.

    Hi Lingaraj,
    We have 2 different Master pages and 2 Body pages. For the seccond Master page the page no are comming correct like 1 of 3 ,2 of 3 and 3 of 3 but for First master page the page no are comming 0 of 3  in all of the page its not displaying the current page no in 1st master page.
    Screen shots are attached for first master page and Hierarchy Node.Pls see the highlighted section in 2nd image.
    Pls see and suggest me accordingly. Hope this helps are let me know anything u require.

  • Auto-number page objects from master pages

    Hello all! I'm trying to set up a photo contact sheet template in InDesign so that we can get rid of the one we're using in Word that's rather...clunky. The only caption underneath each photo will be a simple, basic number that increases sequentially. There are six photos per page. I dove into numbered lists for the first time and figured out how to make the numbered captions work on the regular document pages, but I am trying to avoid creating the caption text box objects there because these contact sheets could be anywhere from 10-40 pages, and it's much easier to just create a slew of new pages from a master page.
    When I transfer the number captions to the master page, the numbers are correctly sequenced when a single new document page is created from that master...but any additional document pages have the same sequential numbers (e.g. 1-6)! Is there a way to get around this?

    Peter, without threading, the individual text boxes on the master page do number correctly. They are empty text boxes except for an invisible character such as a hard return, and once I have the invisible character in place, the numbers appear.
    Because 1-6 already number and appear correctly, it doesn't make sense to me to thread them together, although I did try it including from caption 6 back to caption 1...this resulted in caption 1 disappearing and all the other captions reducing by increments of one (1-5).
    I'm not sure if I'm 'placing' my list incorrectly (that term doesn't quite make sense to me ~ I thought you define a list and then apply it directly or through a paragraph style?) or what, but do you have any other suggestions?

  • Master page Dynamic data not getting displayed in consecutive pages

    Hi,
       I have buit a dynamic form which has some dynamic content in master page and a dynamic table in the body page.
    Layout is
    Master page
          Sub form
                 Field1 -TextView
                 Field2 - TextField      bind with Node1--->Attribute1
                 Field2- TextField       bind with Node2---->Attribute2
                Field n - TextField
    all the text fields are bound to various nodes from RFC
    Body Page
             Sub form
                  Table -Grows Dynamically
    When i run the application all the fields are displayed perfectly in the first page.
    when the table data goes more than one page the problem arises
    The Text fields in the master page is  not displaying the values in the second page ,but the text views and the table values are fine.
    The values are getting displayed in both pages if i put any attribute inside the parent node.Is there any property i need to set at node level or subform level?
    Thanks in advance,
    Siva

    Hi
    I Would like to give a suggestion eventhough i don,t have answer to you question.
    Master Page is used for static content as per SAP and Adobe like company logo and  company address footer section and placing  watermarks etc....
    I feel because of the Dynamic behavior in master page it Leeds this problem.
    Regards
    Malli

  • I am having major issues with links in keynote! Even though the links (a navigation system) are on the master page, they are only working on some of my slides. Anyone have ideas on how to fix this or similar issues? Help!

    I am having major issues with links in keynote! Even though the links (a navigation system) are on the master page, they are only working on some of my slides. Anyone have ideas on how to fix this or similar issues? Help!
    I have created a navigation system on the master pages and set the presentation to links only mode. I also have other links scattered throughout the program, like a linkable table of contents, etc. Some of them work, some of them don't. Not sure why. Anyone out there having similar issues? Or have any idea on how I can solve this issue? Any help would be appreciated!
    Thanks!

    Links should not create any problems in Keynote.  If they are set up correctly on text, the text will be underlined. Objects that have links will have a curved arrow bottom right, if you click the arrow a popup will display the link information.
    Try this repair for Keynote,  ensure you complete all the tasks and in the order shown:

    delete all the iWork applications if you have them, not just Keynote, using Appcleaner from Mac Update, its a freeware application

    empty the trash:  Finder > Empty Trash

    Shut down your Mac, wait 30 seconds, then power on the Mac, immediately after the start chime, hold down the Shift key
    When you see the grey Apple symbol and progress indicator (a spinning gear), release the Shift key.
    If you are prompted to log in, type your password, then hold down the Shift key again as you click Log in.
    4  
    Let the Mac fully boot up, it will take longer as the OS is repairing the drive

    when fully booted, go to Applications > Utilities > Disc Utility; click on the boot drive then First Aid tab and click  repair disc permissions

    when complete, restart the Mac normally, Apple menu > Restart

    install Keynote from the Mac App Store
    let us know if this helped

  • How to remove all pages from layout? (except Master Page)

    Geetings Experts:
    I'm implementing additional security measures into my 'initialze' event, where I'll check some global variables and render the file unreadable if needed.
    Which object and properties do I access to remove all my pages from the form?
    I would like to createa a function that removes all the sub pages, leavning only the Matster Page, enable a label in the MasterPage and save itself.
    I searched for xfa.layout and Page[n].remove() methods but cannot find any reference to these.
    .presence = "hidden", fulfills my purpose but the pages remian visible and I need for a clean solution no pages are visible.
    I'm advanced in C# but a novice in LC JavaScript, so any comment, reference or code snipet will be greatly appreciated
    Thank you for your time,
    Ivan A. Loreto – Computer Education Technician
    LOMA LINDA UNIVERSITY | School of Allied Health Professions - Department of Physical Therapy
    [PDF Development Platform]
    Windows XP SP3
    Acrobat Pro 9
    LifeCycle Designer ES 8.2

    Hi Ivan,
    The particular syntax of Javascript in LC Designer is different from that used in Acrobat and different (as I understand it) from core javascript and other applications. There are several free guides on the Adobe web site which cover Acrobat and LC:
    http://www.adobe.com/go/learn_lc_scriptingBasics
    http://www.adobe.com/go/learn_lc_scriptingReference
    http://www.adobe.com/go/learn_lc_formCalc
    http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Refer ence.pdf
    http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform.pdf
    And a very handy resource (it goes back to version 6, but is still applicable):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
    JP Terry's book on LC Forms is very good and we use www.pdfscripting (which is a subscription service). If you are going to be doing a lot of LC Designer work, these may be of help.
    I am not a coder, so I going to try and work through your script. Bear with me if you already have this sorted...
    The script looks ok and you are using the resolveNode method correctly. Seeing topmostSubform in the resolveNode indicates that you imported an existing document into LC. This is fine, but sometimes it restricts some of the functionality.
    For starters I think that mPg is returning null. You can use the following in your script to see what is happening (debugging) and then comment it out:
    console.println("mpg: " + mPg);
    Then when previewing hit control+J to bring up the javascript console, then will show the value of mPg when that script executes.
    Try deleting the SOM up to #pageSet:
    var mPg = xfa.resolveNode("#pageSet.MasterPage1");
    The javascript console will show you when the script is working.
    In relation to the loop, I would advise a few changes:
    for (var i=1; i <= xfa.layout.pageCount(); i++)
         var vPage = ("xfa.form.topmostSubform.Page" + i).toString();
         //console.println("vPage: " + vPage);
         var curPage = xfa.resolveNode(vPage);
         curPage.presence = "hidden"; 
    }//next page
    There are a few things here:
    I would declare i as a variable, not an integer (not sure if it makes a difference);
    I would use pageCount rather than numPages and then <=;
    There was an extra ; at the end of the loop declaration;
    I would break the script into steps and get the full SOM of the page as a variable first and then resolveNode that variable;
    You don't need to go to the current page;
    I tend to name master pages with a capital "P" and pages with a small "p". Personal preference, but it can make tracking script easier.
    Have a crack off that and hopefully you can get it to work,
    Niall
    ps another tip, if you want to reference an object in script. First click on the object you want to script for and then scroll (or click on the master page) for the object you want to reference. Click inside the script editor and then when you move the mouse back into the form, press and hold Control, this will turn the mouse into a "V". When you click on the object you want to reference it will insert the SOM into the script. If it needs the resolveNode it will automatically put that in for you. Holding Shift and Control will insert a fully resolved node.

Maybe you are looking for

  • How to download/save a AI file from Web

    Hi all, I need to download some ai files from my client's web application in which, whenever I click the links from their web, my acrobat pdf reader 8.0 will be pop-up and I cannot save the ai files under the acrobat pdf reader. Recently, I don't hav

  • PR TO PLANNED ORDER

    Dear experts, Is it possible to convert  semifinish assembly  purchase requisition back to plan order ? we want's  convert the same for inhouse production order. Thanks in advance regards, k.subhash

  • Custom tag or help in reading an image file into the HTTP stream

    Since under WL we do not deploy our app physically there is no physical           directory to write our dynamic images to (via kavachart).           I can call their bean with:           response.setContentType("image/png");           ServletOutputS

  • Garageband 10.0.1 non trovo il sound effects

    Italiano: Salve , in garageband 10.0.1 su Mac OS X 10.9.1 non trovo nella dispozione LEGACY il file SOUN EFFECTS per creare con la keyboard la riproduzione di samples . Per cortesia , qualcuno sa come devo fare? English : in garageband 10.0.1 on Mac

  • Forte 3.0.M.0 - How to distribute user libraries (dll) to nodes?

    Hi, I am new to Forte. I am having dll's which provide some generic functionalities. I am able to access this dll's in the central server. When I am trying to run the same project in a node, I am getting the following error message. SYSTEM ERROR: Exc