Article View: adobe.scripting.indesign
Article #20235Re: [AS] The color/swatch of a text frame is "none"?
From: Shane Stanley
Date: Thu, 17 Oct 2002 22:26
Date: Thu, 17 Oct 2002 22:26
35 lines
2150 bytes
2150 bytes
in article 1de6329f.0@WebX.la2eafNXanI, Olivier Berquin wrote: > tell application "InDesign 2.0.1" > set theTextFrames to object reference of every text frame of active document > repeat with myTextFrame in theTextFrames > set myFillColor to the properties of fill color of myTextFrame > if the name of myFillColor is "None" then > set isEmpty to ((text 1 of myTextFrame = "") or (text 1 of myTextFrame = " > ")) > if isEmpty then > tell myTextFrame to delete > end if > end if > end repeat > end tell One thing to watch is that "every text frame of active document" won't give you a list of every frame in the document -- it will only give you a list of any that are directly on pages or spreads. So any that are in groups or inline will be ignored. So you probably want something like this: tell application "InDesign 2.0.1" set allFrames to all page items of active document repeat with aFrame in allFrames if class of aFrame is text frame and name of fill color of aFrame is "None" and contents of parent story of aFrame = "" then delete aFrame end if end repeat end tell -- Shane Stanley, sstanley@myriad-com.com.au
Technical Details
Message-ID:
<B9D57640.41445%sstanley@myriad-com.com.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.nuthinbutnews.com!propagator2-sterling!news-in-sterling.newsfeed.com!xmission!newsfeed-east.nntpserver.com!nntpserver.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de6329f.-1@WebX.la2eafNXanI> <1de6329f.0@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,460b89554a204fbc,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-10-21 03:58:43 PST From: Shane Stanley <sstanley@myriad-com.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.nuthinbutnews.com!propagator2-sterling!news-in-sterling.newsfeed.com!xmission!newsfeed-east.nntpserver.com!nntpserver.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: [AS] The color/swatch of a text frame is "none"? Message-ID: <B9D57640.41445%sstanley@myriad-com.com.au> Date: Thu, 17 Oct 2002 15:26:41 -0700 References: <1de6329f.-1@WebX.la2eafNXanI> <1de6329f.0@WebX.la2eafNXanI> Lines: 40 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.6 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit