How do I script a 3-up master

Hi,
Hope you can help. I am trying to create a three page masterSpread in indesign cs3.
To do this I have used the masterSpreads.jsx script provided by Adobe and then simply added another page, which seems logical to me, but it does not work.
If I create masters using the two page option and then go into Master Options I can add the page manually.
What I really want is to create a 3-up  external masterSpread and a 3-up internal masterSpread - with different global logos and backgrounds for the specfic pages.
These will then wrap around a conventional 2-up inside section, which will have another masterSpread setting.
I have included the code below for reference.
I assume I need to change the master options to increase the number of pages, and have looked on my well-used Jongware reference but I cannot work it out.
Please help.
Regards,
Gordon Eddey
[email protected]
HERE IS THE SCRIPT AS IT STANDS:
//Set up the first master spread in a new document.
myDocument = app.documents.add();
//Set up the document.
with (myDocument.viewPreferences)
            {/*doc.viewPreferences*/
                            horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS
                            ;  verticalMeasurementUnits = MeasurementUnits.MILLIMETERS
                            ;  rulerOrigin = RulerOrigin.PAGE_ORIGIN
                            ;  showRulers = true
with(myDocument.documentPreferences)
    pageHeight = "297mm"
    ; pageWidth = "210mm"
    ; facingPages = true
    ; pageOrientation = PageOrientation.portrait
    ; pagesPerDocument = 3
//Set the document's ruler origin to page origin. This is very important
//--if you don't do this, getting objects to the correct position on the
//page is much more difficult.
with(myDocument.masterSpreads.item(0))
//Set up the left page (verso).
    with(pages.item(0))
    //Add a simple footer with a section number and page number.
        with(textFrames.add())
            geometricBounds = ["280", "15", "290", "200"]
            insertionPoints.item(0).contents = SpecialCharacters.sectionMarker;
            insertionPoints.item(0).contents = SpecialCharacters.emSpace;
            insertionPoints.item(0).contents = SpecialCharacters.autoPageNumber;
            paragraphs.item(0).justification = Justification.leftAlign;
with(pages.item(1))
        //Add a simple footer with a section number and page number.
        with(textFrames.add())
            geometricBounds = ["280", "15", "290", "200"]
            insertionPoints.item(0).contents = SpecialCharacters.sectionMarker;
            insertionPoints.item(0).contents = SpecialCharacters.emSpace;
            insertionPoints.item(0).contents = SpecialCharacters.autoPageNumber;
            paragraphs.item(0).justification = Justification.leftAlign;
with(pages.item(2))
        //Add a simple footer with a section number and page number.
        with(textFrames.add())
            geometricBounds = ["280", "15", "290", "200"]
            insertionPoints.item(0).contents = SpecialCharacters.sectionMarker;
            insertionPoints.item(0).contents = SpecialCharacters.emSpace;
            insertionPoints.item(0).contents = SpecialCharacters.autoPageNumber;
            paragraphs.item(0).justification = Justification.leftAlign;

Hi
myDocument.documentPreferences.pagesPerDocument = 3;
is not for MasterSpread, it's for PageObject.
So masterSpread[0].pages[2] is not yet existed.
You can fix your code simply rewrite line 58 and try.
GordonEddey wrote:
with(pages.item(2))
to
with(pages.add())
thanks
mg/

Similar Messages

  • How to Use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA

    Hi ,
      How to use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA.
      May i know what are the input parameters & fields mandatory
      for each Table structures ct_data , ct_datax , it_descript , it_longtext.
      Can any one explain me Step by Step Process.
      B'cos i tried with below code. Equipment is not getting created.
      wa_itab-equipment_ext = '000000000100000001'.
      wa_itab-descript      = 'Test 2 -> Lube Oil Pump'.
      wa_itab-text_language = 'EN'.
      wa_itab-sdescript     = 'Short Description'.
      APPEND wa_itab TO it_itab.
      CLEAR  wa_itab.
      LOOP AT it_itab INTO wa_itab.
        ct_data-ta_guid       = '000000000000000001'.
        ct_data-equipment_ext = wa_itab-equipment_ext.
        ct_data-descript      = wa_itab-descript     .
        ct_data-valid_date    = sy-datum.
        ct_data-equicatgry    = 'M'.
        APPEND ct_data.
        CLEAR  ct_data.
        ct_datax-ta_guid       = '000000000000000001'.
        ct_datax-equipment_ext = 'X'.
        ct_datax-equipment     = 'X'.
        APPEND ct_datax.
        CLEAR  ct_datax.
        it_descript-ta_guid       = '000000000000000001'.
        it_descript-text_language = wa_itab-text_language.
        it_descript-descript      = wa_itab-sdescript    .
        APPEND it_descript.
        CLEAR  it_descript.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'LTXT'.
        it_longtext-text_line      = 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'aaaaaaaaaaaaaaa'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'bbbbbbbbbbbb'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'cccccccccccccccc'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      call BAPI-function in this system
        CALL FUNCTION 'BAPI_EQUIPMENT_SAVEREPLICA'
          TABLES
            ct_data     = ct_data
            ct_datax    = ct_datax
            it_descript = it_descript
            it_longtext = it_longtext
            return      = return
          EXCEPTIONS
            OTHERS      = 1.
        IF sy-subrc = 0.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          WRITE : 'Successful'.
        ENDIF.
        IF NOT return IS INITIAL.
          LOOP AT return.
            IF return-type = 'A' OR return-type = 'E'.
              WRITE : 'Error'.
            ENDIF.
          ENDLOOP.
        ENDIF.
        REFRESH  return.
      ENDLOOP.
    Regards
    SUrendar

    Hi ,
      How to use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA.
      May i know what are the input parameters & fields mandatory
      for each Table structures ct_data , ct_datax , it_descript , it_longtext.
      Can any one explain me Step by Step Process.
      B'cos i tried with below code. Equipment is not getting created.
      wa_itab-equipment_ext = '000000000100000001'.
      wa_itab-descript      = 'Test 2 -> Lube Oil Pump'.
      wa_itab-text_language = 'EN'.
      wa_itab-sdescript     = 'Short Description'.
      APPEND wa_itab TO it_itab.
      CLEAR  wa_itab.
      LOOP AT it_itab INTO wa_itab.
        ct_data-ta_guid       = '000000000000000001'.
        ct_data-equipment_ext = wa_itab-equipment_ext.
        ct_data-descript      = wa_itab-descript     .
        ct_data-valid_date    = sy-datum.
        ct_data-equicatgry    = 'M'.
        APPEND ct_data.
        CLEAR  ct_data.
        ct_datax-ta_guid       = '000000000000000001'.
        ct_datax-equipment_ext = 'X'.
        ct_datax-equipment     = 'X'.
        APPEND ct_datax.
        CLEAR  ct_datax.
        it_descript-ta_guid       = '000000000000000001'.
        it_descript-text_language = wa_itab-text_language.
        it_descript-descript      = wa_itab-sdescript    .
        APPEND it_descript.
        CLEAR  it_descript.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'LTXT'.
        it_longtext-text_line      = 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'aaaaaaaaaaaaaaa'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'bbbbbbbbbbbb'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'cccccccccccccccc'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      call BAPI-function in this system
        CALL FUNCTION 'BAPI_EQUIPMENT_SAVEREPLICA'
          TABLES
            ct_data     = ct_data
            ct_datax    = ct_datax
            it_descript = it_descript
            it_longtext = it_longtext
            return      = return
          EXCEPTIONS
            OTHERS      = 1.
        IF sy-subrc = 0.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          WRITE : 'Successful'.
        ENDIF.
        IF NOT return IS INITIAL.
          LOOP AT return.
            IF return-type = 'A' OR return-type = 'E'.
              WRITE : 'Error'.
            ENDIF.
          ENDLOOP.
        ENDIF.
        REFRESH  return.
      ENDLOOP.
    Regards
    SUrendar

  • How do I use a particular question master slide?(Captivate 6)

      Hello,
      I have created my own theme, and with it, several masters of the MCQ,T/F,FIB... question slide.  When I add a multiple choice question slide to my project, it doesn't ask me which of these question masters I want to use, and selects the same master each time.  How do I use different question slide master that I have created?  In other words, how do I change the default MCQ,T/F,FIB.. question master?
    Thank you!
    Ryan

    Can I have different question masters then for one question type?  For example -- five different masters for the hot spot question...
    Ryan

  • How can I script moving paths from one file to another?

    Hello. I have 1 image with various color correction layers. The other is the exact same size but only contains paths. How can I script moving paths from one file to another? Thanks, in advance, for any help you can offer. Thanks!

    Thanks! This one actually worked for me. Thanks for your help.
    http://forums.adobe.com/message/3305389#3305389

  • How can I script a Flash .exe file to always stay on top of all other windows?

    Hi All,
    I'm new to action script, and I just need this one script
    > How can I script a Flash .exe file to always stay on top of
    all other windows?
    Basically what i want to do is have a flash-created
    step-by-step instructional movie, but for the movie to remain on
    top of all windows so the instructee is able to follow the
    instructions on-screen...
    It would be preferable to not have to buy another product
    just to do this... as I said, this is the only scripting I need.
    Thanks in advance
    Cheers
    Rick

    if you create your exe with mProjector you can use one of its
    new AS
    commands to do this.
    setZOrder
    http://www.screentime.com/software/mprojector/docs/mWin_setZOrder.htm
    all APIS
    http://www.screentime.com/software/mprojector/docs/index.html
    Demo
    http://www.screentime.com/software/mprojector/demo.html
    mProjector installs new classes and help into Flash, to
    enable them you
    must build your app with mProjector (its input is your swf)
    John Pattenden
    Screentime Media - Flash Tools since 1997
    http://www.screentime.com

  • How to upload PO text of material master ?

    dear gurus,
    how to upload PO text in material master in mass , can i use LSMW or BDC ? if yes then how?
    I have done the recording but LSMW is not working for PO text.
    Upesh khairnar.

    Hi!
    try using Purchasing Inforecord for this. in here you maintain master data linkage for Material Master and Vendor Master. You will just have to input the Material Number, the Vendor Account, and the Purchasing Org. In here you can maintain the PO text defaulted per Material Number. After the maintenance of Inforecord, the PO text will be reflected on the PO document.
    Here is the ff Transaction Code:
    - ME11 (Create Inforecord)
    - ME12 (Change Inforecord)
    - ME13 (Display Inforecord)
    Hope this helps, Thank you.
    Mik

  • How to Change Batch Classification of material master

    Hi,
    How to Change Batch Classification of material master  in a production system,Pl note that there is no stock and no open qty still system is not allowing me to delete the old Classification and add my new classification.
    Guys any solution for this.
    Thanks in advance
    rgds
    bijaya pradhan

    I believe there is a FM VB_CHANGE_BATCH for this, any body tried this FM?

  • HOW TO STOP THE PROMPTING MESSAGE OF MASTER PASSWORD EACH TIME I OPEN MOZILLA FIREFOX?

    HOW TO STOP THE PROMPTING MESSAGE OF MASTER PASSWORD EACH TIME I OPEN MOZILLA FIREFOX?

    Firefox will ask for the Master Password on startup if it is needed on a page.<br />
    This can be Sync or a web page that is (re)opened automatically and you have saved a name & password for this website.
    You didn't confirm whether you are using Sync or not, so I don't know which of the two would apply.

  • How to activate script debugging in Adobe Livecycle designer

    Friends,
    I would like to know how to activate script debugging in the Adobe Livecycle designer. I need to debug the scripts written in the script editor.
    Thanks and Regards.

    Syntax checking is available in designer from version 8.1 onwards.
    If you want to enable in Adobe Reader then go to Edit --> Preferences --> JavaScript --> Enable the option Show console on Errors on messages.
    Apart from it the alternative way to debug the scripts is to use xfa.host.messageBox and check the values.
    Chintan

  • How to use search term2 in customer master record

    hi
    how to use search term2 in customer master record. can anyone tell me plz
    thanks
    monica

    Hi,
    Search Term 2
    Label used for search helps.
    Only uppercase letters are stored in this field. Your entries are converted automatically to uppercase letters.
    There are two of these fields for search terms. These fields can be used independently of each other.
    Procedure
    You can use your own criteria for entering the search term.
    Example
    You can enter the main part of the name or an organizational ID.
    For example, for the company "Hechinger & Sons", you could enter "Hechinger" as the first search term.
    The second search term could then be the name ID you use within your company, to help you identify your data later.
    Please check out the following link:
    http://help.sap.com/saphelp_47x200/helpdata/EN/01/a9b331455711d182b40000e829fbfe/frameset.htm
    Hope this helps.
    Please assign points as a way to say thanks.
    Regards,

  • How can i do to see the master and text values of the Key figure 0UNIT

    Hi gurus,
    How can i do to see the master and text values of the Key figure 0UNIT, please step by step, i m in the key figure 0UNIT but i want to see if the UNIT  for example BX = BOX, something like this is that i want to check,  thanks!

    If you look at the unit tables, you will see the values and texts.  It's in SPRO, not in RSA1.  My access is limited on my system here, but the documentation says to go to t-code CUNI.  I believe in that tcode you can look at all of the unit equivalencies and what each unit's text is ..... like an ea means each; KG = Kilogram; etc...
    I am on an 3.x system, so in SPRO I go to BW CIG=>General Settings=>Check units of measurement.
    Brian

  • How do I make a new keynote master/theme/background?

    I love keynote, but the included masters/themes/backgrounds included are (necessarily) quite limited. I want to use other backgrounds, but I want to make sure that I am not unnecessarily overloading the slideshow size for slide backgrounds. Keynote v. 6.5...

    How do I make a new keynote master/theme/background?
    master:
    view > edit master slide
    click on the blank master then duplicate it using right click or (Command D)
    rename the new master
    theme:
    create a new design on a new master slide then:
    file > save theme
    add to theme chooser
    background:
    click on the slide background then;    Inspector > Format > Background:  click the dropdown menu and select from colour , gradient or image
    The inspector is the side panel on the right

  • How to use Script in ADF model?

    Hi!
    I don't know how to use Script in ADF model. Help me, please!
    Detail: javaScript.
    Thanks so much!

    You can put your Javascript code in the Onmouseover property of the column.
    I don't have the Javascript code for changing the color but for example the following will pop up an alert
    <af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')">

  • Hi Experts.. How to make scripts & SmartFrom Unicode enable

    Hi Experts..
    How to make Scripts & Smart From Unicode enable? i know for scripts we need to check with driver program & 
    For smart from we need to check the generated function module. Correct me if am wrong. 
    I wanna to know how to make layouts & from Unicode conversion....or enable??
    Thanks In Advance
    Santosh.S
    Points for sure ...

    Hi Donghai,
    Have you tried using the command
    CHAIN ENDCHAIN.
    Try displaying the message for te field you wish to within CHAIN and ENDCHAIN which will allow you to enter the data in the field even after the error message is displayed.
    Caution: Mention all the field names in CHAIN and ENDCHAIN which you want to be open for enterin the values into it.
    Thanks and Regards,
    Kunjal Patel

  • Strange Case..!! How 2 set an item as a master block to it's db items block

    Hello All,
    i have a question pls.
    ================
    How 2 set an item as a master block to it's related db items in the same data block; as follows:
    ============
    1-i have to enter the item's value ('LAB_TEMP' ) once then;
    2-the other related items in the same data block r changed record each time i navigate to the next record but this item is never changed in this case only if i re-entered another value as (master-detailed rel.). i tried to copy the value of this item to a display item called 'Temp' but it is changing according to the records frequency by default
    ===========================================================
    I tried the following code on when-new-record-instance & on post-changed Triggers as follows:
    ============================================================
    IF :LAB_TEMP IS NOT NULL THEN
    SET_ITEM_PROPERTY ('LAB_TEMP',ENABLED,PROPERTY_FALSE);
    SET_ITEM_PROPERTY ('LAB_TEMP',NAVIGABLE,PROPERTY_FALSE);
    SET_ITEM_PROPERTY ('TEMP',VISIBLE,PROPERTY_TRUE);
    SET_ITEM_PROPERTY ('LAB_TEMP',VISIBLE,PROPERTY_FALSE);
    :TEMP := :LAB_TEMP;
    ELSE
    SET_ITEM_PROPERTY ('LAB_TEMP',ENABLED,PROPERTY_TRUE);
    SET_ITEM_PROPERTY ('LAB_TEMP',NAVIGABLE,PROPERTY_TRUE);
    SET_ITEM_PROPERTY ('TEMP',VISIBLE,PROPERTY_FALSE);
    SET_ITEM_PROPERTY ('LAB_TEMP',VISIBLE,PROPERTY_TRUE);
    :TEMP := :LAB_TEMP;
    END IF;
    ============================================================
    even this generates unable to set enable property or visible prop. error
    ====================================================
    Someone help me with this pls.??
    ========================
    Thanks in advance,
    Regards,
    Abdetu..

    Hello everyone,
    This issue was solved as:
    ==================
    1-i created a separate db block
    2-created a text item called 'TEMP' with db=NO
    3-In the db block that i want to deal with it as:Master item to it's other related detailed items to that item which is called 'LAB_TEMP' ;
    * Copy value from property: TEMP.
    By this way i could entered a value i the ndb item called TEMP once & consequently this value is entered copyed 4 each new record i entered.
    This is an intial solution works fine at least 4 now, a Fried helped me with this i would like 2 share this info 2 others may be a new idea would help...
    Thanks always,
    Abdetu..

Maybe you are looking for