Article View: adobe.scripting.indesign
Article #19350Help to convert VB Script to AppleScript
From: pjredman
Date: Mon, 06 Jan 2003 14:27
Date: Mon, 06 Jan 2003 14:27
38 lines
2260 bytes
2260 bytes
Hi folks,
I've been handing out the following script in the Windows InDesign forum. It removes paragraph style overrides throughout the active document in all text and tables. I've had some requests for a Macintosh version of the script but I don't know AppleScript. Would someone be willing to convert this to Applescript and post is back to this forum? I'm a rather newbie programmer so you're welcome to modify the script to make it more efficient etc.
Thanks,
Phil Redman
Dim myInDesign As InDesign.Application
Dim myDocument As InDesign.Document
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.ActiveDocument
Set myStories = myDocument.Stories
Rem Remove paragraph style overrides in text
For Each Story In myStories
Set myParagraphs = Story.Paragraphs
For Each Paragraph In myParagraphs
Rem Reset the paragraph style to its current assigned value; clearing all style overrides
Paragraph.ParagraphStyle = Paragraph.ParagraphStyle
Next Paragraph
Next Story
End If
Rem Remove paragraph style overrides in tables
For Each Story In myStories
Set myTables = Story.Tables
For Each Table In myTables
Set myCells = Table.Cells
For Each Cell In myCells
Set myParagraphs = Cell.Paragraphs
For Each Paragraph In myParagraphs
Rem Reset the paragraph style to its current assigned value; clearing all style overrides
Paragraph.ParagraphStyle = Paragraph.ParagraphStyle
Next Paragraph
Next Cell
Next Table
Next Story
End If
Technical Details
Message-ID:
<1de74010.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,5bdb0e6d7a11cf45,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-01-06 06:38:06 PST From: pjredman <pjredman@usgs.gov> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Help to convert VB Script to AppleScript Message-ID: <1de74010.-1@WebX.la2eafNXanI> Date: Mon, 6 Jan 2003 06:27:40 -0800 Lines: 46 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit