Need script to insert pages with specified master

Several years ago, someone here (I think Dave, maybe Ole) helped me out by giving me a short script that when run added a blank page (with a specified master page different from the previous page) after each page of a document.
I've had an emergency reformat of my system and have lost that script which I need constantly for work projects. I tried searching here, but it was before the current forum setup (I think around 2 years ago) and I can't find a way to get to the archives.
If anyone can either provide me with the java script code for this or point me to the old messages about it, I'd be very appreciative.
And, BTW, I am now using CS4 (though I'm sure the script I've been using was from an older version).
Thank you.

Aaahhh ... PageMaker scripting. Now there was a challenge -- I don't think I ever could write the thing I intended with that.
This quick javascript works on CS, but I don't think the syntax has changed (much) for CS4. Yell if it doesn't work.
Be sure to fill in the right 'blank page' name in the first line! That includes the prefix and the hyphen -- the script will alert you if you got it wrong
//DESCRIPTION: Add Blank Master Page after each page
masterPageName = "A-AddMe";
masterPage = app.activeDocument.masterSpreads.item(masterPageName);
if (masterPage == null)
alert ('"'+masterPageName+'" is not a valid master...');
exit(0);
// Start at the end:
currentPage = app.activeDocument.pages.length-1;
while (currentPage >= 0)
theNewPage = app.activeDocument.pages.add (LocationOptions.AFTER, app.activeDocument.pages[currentPage]);
theNewPage.appliedMaster = masterPage;
currentPage--;
Copy, paste into a plain text editor (InDesign's ESTK is good) and save as "insertBlanksAfterAll.jsx" in your Scripts folder. When saved in the right folder, it will automatically become available in the Scripts Panel.

Similar Messages

  • Error in a page with a master-detail:Unable to resolve a Validator instance

    Hi all,
    I am using Jdeveloper 11.1.1.2
    I have a page with a master table and a detail table.
    When I try to select a row in the some tables (master or detail), I have this error:
    <AbstractValidatorTag><createValidator> Unable to resolve a Validator instance using either validatorId ' or binding #{row.bindings.IdLocazione.validator}.
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    javax.servlet.ServletException: Unable to resolve a Validator instance using either validatorId '' or binding '#{row.bindings.IdLocazione.validator}'.
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Any suggestions?
    Thanks
    Andrea
    Edited by: Andrea9 on 17-feb-2010 00:45

    I am using ADF, I can reproduce in a testcase, but I need time.
    If you want, I can cut and paste the jspx page.
    However, I have a panelStretchLayout: on top facet I have the master table, while in the center facet I have the detail table.
    I have a query component to filtering data of the master table.
    I have this problem doing this:
    1) create a new record on master table.
    2) create some records on detail table (sons of the record of the master table just created).
    3) clicking on "find" of the query component.
    I have tried to do a master-detail with the HR connection using Departments table (master) and Employee (detail). When I try to delete a departments, it does not work, because I have to delete the employees first, while in my case I want to delete the master and the detail in cascade.
    Thanks
    Edited by: Andrea9 on 17-feb-2010 08:25

  • Import multiple Word docs to multiple pages with same master page?

    Hi, I should start by saying I have no scripting experience.  However, I am wondering if there is a simple script available for the following issue:
    I have set up a master page with three linked text boxes. Right now, I use Cmd+D to select a word file, and then Shift+click in the first box to place the text on the page. But I have 125 pages that are exactly the same layout, just different Word files to be imported. I could repeat this process 125 times, but I am wondering if there is a way to tell InDesign to create 125 pages using Master Page X and import one file for each?
    I am using InDesign CS5 v 7.0.4 on Mac OSX Snow Leopard v 10.6.7
    Thank in advance for any help you can offer,
    NW

    I was able to import the word documents as long as there was only one text frame on the master page. However, when I created multiple text frames (the text in the word document needs to flow from frame 1 to frame 2), it always imported into frame 2 and skipped frame 1. In case it is helpful to understand what I mean, I attach two screenshots. The first (sans text) is the master page, and the second is Page 1 after running the script. I added the labels Frame 1 and Frame 2 to Page 1, not the Master, because otherwise the text gets imported into the frame with the words "Frame 2". I suspect I have to label the frames in InDesign and then add something to the script that says insert into the Frame 1, but I'm not sure how to do that.
    It wasn't clear from your narrative in June that the text frames were linked, and that the text needed to flow between frames.
    The script, as implemented, only overrides one text frame, (textFrames[0],  which is the top-most text frame in the stacking order), and then places the text in it. Clearly that's not correct for your scenario.
    You mention 3 frames but only mention flowing between 2 frames.
    Anyhow, it sounds like you want the script to override all 3 text frames, and then to place in the first textframe.
    The first is easy, the question is really what should happen when there are more than 3 text frames -- should it override all text frames, or only some. You could specify which ones with a Script Label, or you could do something more clever. For the moment, let's just override all text frames.
    Then you have to specify which one to place into. You could just select the frame you want and Arrange > Bring To Front. Or we could specify frames[2], which should be the 3rd-from-the-top (after frames[0] and frames[1]). I'll do the latter, but feel free to keep the script the same and do the former:
    var
        d=app.activeDocument,
        p=d.pages,
        i, frames;
    for (i=0; i<p.length; i++) {
        frames = p[i].appliedMaster.textFrames.everyItem().override(p[i]);
        frames[2].place(new File("/path/to/page"+p[i].name+".doc"));

  • Script to extract pages with comments

    I know that what I would like to do is probably quite simple. I'm trying to automatically take a source document, and extract all pages with comments to a new document.  Ideally, I would have multiple versions of this script for different purposes.  I used to be a business analyst years ago, but it's been years since I've written any code, and even back then I used SQL almost exclusively--it's been about 12 years since I've written any code other than SQL queries, and back then it was highschool projects written in C++ before OOP was really a big thing.  I'd attempt to read documentation myself and figure it out, but I really don't even know where to start -- my CS knowledge at this point is pretty much only conceptual.  Whenever I have a similar VBscript problem using MS software, usually all I do is find an existing function and modify one or two lines to meet my needs, so I've never really had to learn how the scripts I've used work.  I just tinker with existing stuff to get what I need.  My past coding experience does give me an idea is to the general algorithm that I think would work.  To show that I really tried with this one, I paste my guess as to how I would code this below: 
    1)     Create For loop for source doc.
    2)     Create FOR loop for new doc
    3)     Analyze page in source doc
    4)     IF source page has any comments or highlighting THEN somehow note that page and increment "new doc" counter
    5)     Increment source doc counter
    6)     Repeat 3-5 until all pages in source doc have been analyzed
    7)     Create new file
    8)     Extract pages noted during step 4 to new file.
    If someone could help me create the above script, I would probably be smart enough to get it to meet my needs.  What I'd really like are two versions of that script.  If asking for the community to simply provide me with code is not a cool thing to do, could someone link me to a good tutorial and/or existing scripts so I could try and figure it out myself?
    1)     One that extracts only pages with text comments (using the typewriter tool).
    2)     One that extracts pages with highlights or text comments.

    In the second to last line of my OP I meant "using the 'Add text comment' tool" not "using the typewriter tool".

  • [JS] Export jpg from each page with specified number from database

    Hello,
    I imported a database into InDesign (CS 5 with OS X 10.7.2), so that every product and product number is on a different page in InDesign. Now I need to export each page to a jpg-file. The name of the jpg should be "productnumber.jpg".
    I found the script „PDFExportCropper.jsxbin“, which does what I want but creates pdf-files instead of jpgs.Thereafter, I can convert the pdfs to jpgs automatically with Photoshop.
    But: The script takes hours and hours to create the pdf-files: Right now, more than 8 hours for only 100 pdf-files. The database has 65.000 products!
    Any idea to improve the workflow? Any other script available which I did not find but does what I need?
    As a designer, I have no experiences at all in scripting.
    Thanks for answering!
    Best regards
    Rainer
    from Germany

    I think I fixed it.
    In line 20, I have now the following code:
    var page = myImage[i].parentPage.name;
    Is this the right way, to get the actual page?
    Also I would like to know, how can I export the images cropped to their "box"? How do I have to change my script?
    Thanks

  • In MVC, do i need a View or Page with flow logic for POPUP window

    Hi All,
    I have the below scenario using the MVC pattern.
    I have a main view with 3 trays, each tray has two buttons, for example first tray has Create Order button. When I click on this button, I need a popup window to come with a tableview and a button(Create), where I select some rows and click on the button Create  to create order.
    But as per the MVC pattern I canu2019t call the view (popup) from another view(main view).  So should I create a VIEW or PAGE WITH FLOW LOGIC for the popup? .
    I need 6 popup to be called from the main view and once the function is done close the popup.
    Please suggest me the flow for this scenario.
    Cheers,
    Srini.

    Srini,
    1. You can call the view in pop-up because you will be calling the controller using open.window.
    Here is the sample code:
    method DO_REQUEST .
      data:
            li_vw           type ref to   if_bsp_page,
            lv_form_field   type          string,
            li_md           type ref to   zcl_model01.
      dispatch_input( ).
      li_md ?= get_model( 'm01' ).
      lv_form_field = request->get_form_field( 'invoice_create' ).
      if lv_form_field is initial.
    *------ Request to display main page
        li_vw = create_view( view_name = 'main.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      elseif lv_form_field eq 'true'.
    *------ Request to display Invoice page in pop-up
        li_vw = create_view( view_name = 'invoice.htm' ).
        li_vw->set_attribute( name = 'model' value = li_md ).
        call_view( li_vw ).
      endif.
    endmethod.
    Layout:
          function do_Invoice()
          { var s=0; r=1; w=300; h=300; x=screen.width/2;
            x=x-w/2;
            var y=screen.height/4;
            y=y-h/2;
            popUp=window.open('main.do?invoice_create=true','win','width='+ w
            +',height='+ h +', left=' + x +',top='+ y +');
    Option2:
    Ofcourse you can't bind the model in page becos those are 2 different things. But all you need to do is access the model to get some value. To know how to access the model from Page w/flow logic look at [this link|Passing model reference to a page in a Popup].
    Raja
    Edited by: Raja Thangamani on Apr 14, 2009 11:22 AM

  • HT1539 my daughter has taken the insert page with redemption code out of the dvd case and we cannot find it.  is there any way i can still download my digital copy of the movie in itunes?

    We Have managed to lose the insert page that came with our dvd and digital copy.  Is there a way i can still download the digital copy without the redemption code?

    Please please help me, if you know how.

  • Insert Page Name in Master page

    Hello.
    I was wondering if there was an easy way to insert the page name inside a master page, something like indesign's variable ?
    If i want this exactly like the widgets (drag and drop a box, it places with editable attribute of pageitem::menu), i'm ok to type and paste some html.
    (I also wonder how to use the widgets.muse file to build my own, but that's another question i guess)

    Thanks, this sounds like just what I'm after. However…
    I feel pretty silly asking this, but I can't understand the Adobe Help files on overriding a master item.
    It lists a two step process:
    Make sure the master item can be overridden -this seems to be fine. After selecting the inserted File Name in the master I can see a tick next to Allow Master Item Overrides On Selection in the Pages panel menu.
    Override specific master items on a document page - this is where I get lost.
    Firstly I can't select the items on a regular (non-master) page. Am I meant to select them on the master page?
    Secondly the help file simply says "Change the selected master items as desired." How do I change them. There's no explicit instruction, and I can't for the life of me work it out.
    More generally (if this does happen on a master), do I need to make this change on every document in the book, or can I simply make the change on the Style Source and then synchronise the remaining files?

  • Need script to insert records

    Hi all,
    I have to insert table LOCAL with entire contents of table REMOTE, minus any duplicates. Both tables have identical structures just hold different years of data. End result needs to be 1 gigantic table of all years. The tables have 7 indexes on each. Each table has about 20 million records. Any suggestions?
    I do not know PL/SQL well. Given a generic script I should be able to figure it out.
    Many thanks

    I'm sorry I should of mention that the year data in both tables are overlapping.
    It was recommended by the vendor to purge historical data off. This alleviated the bogging down of the production database with querying very large tables. So every couple years the database was cloned to an archive database and used for reporting purposes.
    The end result: we have an administrative nightmare. The goal is to get all historical data into 1 reporting db.
    There is actually 4 archive dbs I am trying to merge into 1. ie 1 database has some 2001, all 2002-2003, some 2004. The 2nd has some 2004, all 2005-2006, some 2007. This is a financial/payroll database containing records with many different dates. For example on the finance - this particular table I have requested for help om a query has 4 different dates - -transaction date,, approval date, a check date and a reconciliation date (which may be in that year or not, or never has been reconciled) ....
    This was the concern for the duplicates.
    Thank you

  • Needing script to move files with name that starts with

    Here is part of the script that takes a excel file for the list to duplicate files from one folder the another. I would like it to use file name starts with instead exact file name. If I can get this to work I will not have to have a try for .jpg and a seperate try for .eps
                tell application "Finder"
                    try
                        duplicate (sourceFolder & theItem & ".jpg" as string) to destFolder with replacing
                    on error
                        do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                    end try
                    try
                        duplicate (sourceFolder & theItem & ".eps" as string) to destFolder with replacing
                    on error
                        do shell script "echo " & theItem & ">> $HOME/Desktop/NotFound.txt"
                    end try
                end tell
    Thanks

    Ok here is the script that I've been using for a couple of years now with no problems, until I upgraded. Don't know what happened, because I cant even use it on a older system that we have. The error I get is when it tries to get the value of selection from Excel. It times out with no values. Thanks for any help!
    set sourceFolder to choose folder with prompt "Select the folder that contains images to move."
    set destFolder to choose folder with prompt "Select the destination folder"
    if sourceFolder is not destFolder then my moveImageFiles(sourceFolder as string, destFolder)
    on moveImageFiles(sFolder, dFolder)
        script o
            property valuesList : {}
        end script
       tell application "Microsoft Excel" to set o's valuesList to value of the selection
        if class of o's valuesList is not list then return -- not multiple selection
        set tc to (count o's valuesList)
        set dFolder to quoted form of POSIX path of dFolder
        set errorFile to quoted form of POSIX path of (sFolder & "filesNotFound or NotMoved.txt")
        do shell script "/bin/rm " & errorFile & " > /dev/null 2>&1 &" -- remove the error file (if it exists)
        repeat with i from 1 to tc
            repeat with thisValue in (get item i of o's valuesList)
                if contents of thisValue is not "" then -- not a blank cell
                    set tFile to quoted form of POSIX path of (sFolder & thisValue)
                    try
                        do shell script "shopt -s nocaseglob; /bin/mv -f " & tFile & "* " & dFolder
                    end try
                end if
            end repeat
        end repeat   
        do shell script "/usr/bin/open -b com.apple.textedit " & errorFile & " > /dev/null 2>&1 &"
    end moveImageFiles

  • I need to scan multiple pages with my HP 6520.

    I saw the instructions on how to do it with a mac- but I have a PC- HP Pavillion 21.
    Please help- thank you.

    Hi,
    For Windows, after scanning the first page, please don't save, click Add pages (a small lus (+) sign) on the left hand side of the preview window to scan the second page and repeat for all following page(s). You then save after the last page.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Need script to replace "J/" with "*" in PDF form.

    This is an error I'm getting when I scan specific barcodes into a form field. Everything works fine unless there is a "*" (asterisk) in the barcode. If there is one, it gets replaced with "J/" in the form field. Is there a setting I can change in LiveCycle Designer ES2 or Acrobat Pro X to let the field accept "*", or, if not, what is a basic string replace script that would automatically fix this? I thank you for any ideas.

    Pat,
    Is it just the asterisk that you're concerned about, or any of the other characters (e.g., lowercase letters) as well that get similarly encoded? I could show you how to do it in an Acroform, but if this is for a form that you created in LiveCycle Designer, you should ask in the LiveCycle Designer forum: http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es?view=discussions

  • Export as Separate PDF Pages with Unique Names

    I have an InDesign document that has several pages. I want to export each page as a seperate PDF, but they have to have a unique name that I want to be able to specify.
    For example, I want to export page 1 as "calendar page 2014"
    Page 2 as "Diary page 2014" etc.
    I found some solutions, but they aren't quite what I need:
    Export as Seperate pages with image name
    This apple script takes the name of the first image on the document and uses that as the name.
    However, my document has no images.
    Exportools
    A paid tool that offers many options for exporting. However, the name has to be based on a pattern, which is no good for me.
    I'm hoping that there will be a script that can take the name from a non-printing area/layer. That way, I can just put the desired name on the page and it will export with that name each time.

    have you looked at the extention Autosplit PRO?  This may be what you are looking for.  (Although, I don't think this software is compatable with MAC...but if you find out otherwise, please advise!)
    good luck..

  • Best way to insert pages from a document to another

    Hi everybody,
    I need to append/insert pages from a InDesign CS4 document to another one with all the content that may be present in page.
    What is the best way to implement that? I didn't find anything similar to kAddDocToBookCmdBoss.
    The optimum would be to have something like kAddPageToDocCmdBoss for better granularity.
    Thanks a lot in advance to anybody who will express his opinion.
    Luca Severini

    The Pages panel flyout menu has a "Move Pages..." action / dialog.
    It fires off several commands:
    kCreatePageFromPageCmdBoss
    cmd target is the target document
    UIDList is the source kSpreadBoss.
    IID_ILAYOUTCMDDATA document is the target doc again.
    followed by kMoveSpreadCmdBoss and kShufflePagesCmdBoss.
    Dirk

  • Unable to Insert  Pages

    I have Adobe Acrobat 8 Standard v 8.1.2
    I am using Windows XP
    Using my older version of Adobe I was able to insert pages with no problem. With my recent upgrade I am no longer able to do this. For example: I make a purchase. I convert the email confirmation of the order to PDF. Then I convert the PayPal confirmation to PDF. I want to file the two together for a complete receipt. Both are converted using my existing Adobe software.
    When I attempt to *Insert Pages*, instead of the page, I get a box with a message, as follows:
    "Multiple files are bound together in this PDF Package. Adobe recommends using Adobe Reader or Adobe Acrobat version 8 or later to work with documents contained within a PDF Package. By updating to the latest version, you'll enjoy the following benefits: (blah blah blah). Dont have the latest version of Adobe Reader? Click here to download the latest version of Adobe Reader If you already have Adobe Reader 8, click a file in this PDF Package to view it."
    There is no PDF package. It does not combine the two files. I clicked on Help .. Check for Updates .. and it tells me that I do not need any updates.
    Can you help me with this problem? Thanks so much. :-)

    I've found the best way to insert pages in a PDF is to show the "Pages" pane on each PDF you have open and drag the page from one to the other via the pane window.
    Have you tried that instead of via the menu?

Maybe you are looking for

  • SMS Provider Locations Do Not Match - Problem installing SCCM 2012 R2 CU4

    I have an SCCM 2012R2 CU1 site that has been upgraded from SCCM 2012 non-SP1, so I have gone from 2012 to 2012SP1 through CU5 and then to R2 and then to CU1. Over the course of the life of this site, which has more than 10k clients and 10 Site System

  • Error while setting up the configuration for XI integration builder

    Hi experts, I am trying to configure the XI integration builder. I have created an entry in table SPROXSET and created an RFC destination of type G. After that I am trying to execute the SPROXY, I am getting an error "IFR_HTTP_DEST must not be set in

  • Captivate published Swf to open an external PDF file

    Hi all, I need help to open an external PDF file from the swf file. I used this previously. But realised that I can only open the pdf file from the published html file but not the swf file. function onClick() { window.open("mypdf.pdf"); onClick(); Ca

  • E51 menu hang

    i know this was discussed, but with search i didn't found anything about this problem. my problem is that today, after a month using without any problems, my E51 didn't entered the menu. from standby i pushed the menu button, but the menu didn't open

  • Installing Imagemagick on OSX Server

    Hi I'm trying to install Imagemagick onto the server. If I follow these instructions http://www.imagemagick.org/script/binary-releases.php?ImageMagick=1l0pnkv7t9gp1m a6p2vi3epu13#macosx I get an error of: dyld: unknown required load command 0x8000002