Article View: adobe.scripting.indesign
Article #18874Re: use master page
From: BATTISTELLI Laurent
Date: Fri, 14 Feb 2003 15:20
Date: Fri, 14 Feb 2003 15:20
107 lines
5194 bytes
5194 bytes
thanks for your answer
I tried the sample code
Set myInDesign = CreateObject("InDesign.Application.2.0")
> Set myDocument = myInDesign.Documents.Add
> Set myMasterSpread = myDocument.MasterSpreads.Item(1)
> If myMasterSpread.Pages.Count > 1 Then
> Do While myMasterSpread.Pages.Count > 1
> myMasterSpread.Pages.Item(1).Delete
> Loop
> End If
> Set myMasterPage = myMasterSpread.Pages.Item(1)
> Rem Create a master page item.
> Set myMasterItem = myMasterPage.Polygons.Add
> myMasterItem.GeometricBounds = Array("6p", "6p", "24p", "24p")
> Rem Create another master item.
> Set myMasterItem = myMasterPage.Polygons.Add
> myMasterItem.GeometricBounds = Array("18p", "18p", "36p", "36p")
> Set myPage = myDocument.Pages.Item(1)
> myPage.AppliedMaster = myMasterSpread
> Rem Override the master page item.
> Set myOverriddenPageItem = myPage.MasterPageItems.Item(1)
> Rem Look at the document page. You'll see that the first master page
item is overridden.
> Rem If you look at the object using the WatchWindow or Locals window,
you'll see that
> Rem its overridden property has changed from false to true.
its work fine but when I want to imcorporate in my code by using an
existing master page it didn't work
do you think that problem can appear if we don't create the master just
before trying to overridde ???
I just ask this because I try to simplify my code and for the moment I
apply a master and after as I can not overridde textbloc i recreate all
textbloc one by one !!
for my project I open a document where page en master are define I open
a XML file and apply the master define in xml and after complete all
textbloc with the information of the xml. That give you an idea of my
project
thanks
Olav Kvern a οΏ½crit:
> Laurent--
>
> re: overridden
>
> This property is read only. It gets set when you override a master page item, which you do using something like the following:
>
>
>
> Set myOverriddenPageItem = Document.Pages.Item(1).MasterPageItems.Item(1)
>
>
>
>
> The other threads talk about a bug in accessing master page items (that iterating through the items copies all of them to the document page), and how to avoid the problem (by finding the page item and its index on the applied master page).
>
> Here is an example:
>
>
>
> Set myInDesign = CreateObject("InDesign.Application.2.0")
> Set myDocument = myInDesign.Documents.Add
> Set myMasterSpread = myDocument.MasterSpreads.Item(1)
> If myMasterSpread.Pages.Count > 1 Then
> Do While myMasterSpread.Pages.Count > 1
> myMasterSpread.Pages.Item(1).Delete
> Loop
> End If
> Set myMasterPage = myMasterSpread.Pages.Item(1)
> Rem Create a master page item.
> Set myMasterItem = myMasterPage.Polygons.Add
> myMasterItem.GeometricBounds = Array("6p", "6p", "24p", "24p")
> Rem Create another master item.
> Set myMasterItem = myMasterPage.Polygons.Add
> myMasterItem.GeometricBounds = Array("18p", "18p", "36p", "36p")
> Set myPage = myDocument.Pages.Item(1)
> myPage.AppliedMaster = myMasterSpread
> Rem Override the master page item.
> Set myOverriddenPageItem = myPage.MasterPageItems.Item(1)
> Rem Look at the document page. You'll see that the first master page item is overridden.
> Rem If you look at the object using the WatchWindow or Locals window, you'll see that
> Rem its overridden property has changed from false to true.
>
>
>
>
> To find out how to search for and override a specific master page item, search the forum for "masterpageitem" and you'll find more example scripts.
>
> re: dictionaries
>
> I don't know the list of available language dictionaries for InDesign, but I'm sure you can find out by looking at the product information on InDesign at adobe.com and at WinSoft's web site (for CE and ME supported languages). That's why I didn't answer that question, which really didn't have anything to do with scripting.
>
> I'm sorry if the lack of a response on that question upsets you, but I think I've responded fairly well to your scripting-related questions.
>
> Thanks,
>
> Ole
Technical Details
Message-ID:
<3E4D093C.9030608@comidoc.fr>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<3E4113E8.1060604@comidoc.fr> <1de7b559.4@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,ff1d5253cfa97279 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-02-14 07:38:52 PST From: BATTISTELLI Laurent <l.battistelli@comidoc.fr> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: use master page Message-ID: <3E4D093C.9030608@comidoc.fr> Date: Fri, 14 Feb 2003 07:20:28 -0800 References: <3E4113E8.1060604@comidoc.fr> <1de7b559.4@WebX.la2eafNXanI> Lines: 127 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: fr-fr, fr MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit