🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18615

Re: from applescript to visual basic

#18615
From: Olav Kvern
Date: Thu, 06 Mar 2003 20:33
37 lines
1817 bytes
Gerald--

Something like this, I think:



Dim myInDesign As InDesign.Application 
Set myInDesign = CreateObject("InDesign.Application.2.0") 
Set myDocument = myInDesign.ActiveDocument 
For myPageCounter = 1 To myDocument.Pages.Count 
    myMasterItemExists = True 
    myMasterItemCounter = 1 
    Set myPage = myDocument.Pages.Item(myPageCounter) 
    Rem Turn normal error checking off and handle errors. 
    On Error Resume Next 
    Err.Clear 
    Do While myMasterItemExists = True 
        Set myMasterItem = myPage.MasterPageItems.Item(myMasterItemCounter) 
        If Err.Number <> 0 Then 
            myMasterItemExists = False 
        Else 
            myMasterItem.Unlink idMasterSpread 
            myMasterItemCounter = myMasterItemCounter + 1 
        End If 
    Loop 
    Rem Restore normal error checking. 
    On Error GoTo 0 
Next 




There are lots of other ways to do it. MasterPageItems is a somewhat odd object--as we've discussed in other threads.

Thanks,

Ole
Technical Details
Message-ID: <1de82b16.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!204.127.161.8.MISMATCH!wn14feed!wn13feed!wn12feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de82b16.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,1742becda4c537f7
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-03-06 12:37:59 PST
From: "Olav Kvern" <okvern@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!204.127.161.8.MISMATCH!wn14feed!wn13feed!wn12feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: from applescript to visual basic
Message-ID: <1de82b16.0@WebX.la2eafNXanI>
Date: Thu, 6 Mar 2003 12:33:12 -0800
References: <1de82b16.-1@WebX.la2eafNXanI>
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit