🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17748

Re: AS - Tab stop in paragraph

#17748
From: Dave Saunders
Date: Wed, 14 May 2003 14:41
30 lines
1841 bytes
Choosing the story is OK (provided it really is story 1 -- what if you have 16 stories and you want the script to work only on story 7, how will you identify the story?). What I normally do for cases like this is have the user click in the story of interest.

You've gone rather wrong with setting the properties of the tabs. Because you're creating a whole bunch of tabs at once in multiple paragraphs, you either need to set the properties at the same time or cycle through the tabs and set them one at a time afterwards.

This works:

tell application "InDesign 2.0.2"
 set myStory to parent story of selection
 tell every paragraph of myStory
  set myTabs to (make tab stop) as list -- in case there's only one
 end tell
 repeat with myTab in myTabs
  tell myTab
   set position to 56.5
   set alignment to right
   set leader to "-"
  end tell
 end repeat
end tell

This is faster:

tell application "InDesign 2.0.2"
 set myStory to parent story of selection
 tell every paragraph of myStory
  make tab stop with properties {position: 56.5, alignment: right, leader: "-"}
 end tell
end tell

Dave
Technical Details
Message-ID: <1de91f47.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de91f47.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,c14ed4311c08166f
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-14 08:08:08 PST
From: "Dave Saunders" <daves@pdsassoc.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: AS - Tab stop in paragraph
Message-ID: <1de91f47.0@WebX.la2eafNXanI>
Date: Wed, 14 May 2003 07:41:56 -0700
References: <1de91f47.-1@WebX.la2eafNXanI>
Lines: 37
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit