🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18377

Re: Total Newbie with VB Needs Help

#18377
From: Iolaire McFadden
Date: Thu, 03 Apr 2003 15:35
28 lines
1874 bytes
Here is a sample for that might not work (sorry I don't do rectangles yet) but it is a starting point:

Sub update_strokes()
Dim strokecount
Set myInDesign = CreateObject("InDesign.application.2.0")
REM you need to have your document open
Set myDocument = myInDesign.ActiveDocument
strokecount = myDocument.Rectangles.Count
For strokeloop = strokecount To 1 Step -1
Rem This might not work, you will need to test
Rem to figure out how to get the strokewight
myjunk = myDocument.Rectangle.Item(strokeloop).strokeweight
If myjunk = 0.5 Then
Rem This might not work, you will need to test
Rem how to change the stroke weight
Set myDocument.Rectangle.Item(strokeloop).strokeweight = 1
Else
End If
Next
End Sub

So you need to go into Visual Basic in say Excel, under tools, references add: Adobe InDesign 2.0 Type Library.

Then create new module and add this code hit F8 to step through it or F5 to just run it.

You might look in the scripting manual and Adobe Exchange to see if they have any samples that deal with stroke weights.
Good luck,
iolaire
Technical Details
Message-ID: <1de894ee.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.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
References: <1de894ee.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,9dc40f7b1f727876
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-03 07:40:06 PST
From: "Iolaire McFadden" <imcfadden@costar.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.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: Total Newbie with VB Needs Help
Message-ID: <1de894ee.3@WebX.la2eafNXanI>
Date: Thu, 3 Apr 2003 07:35:52 -0800
References: <1de894ee.-1@WebX.la2eafNXanI>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit