Article View: adobe.scripting.indesign
Article #18648Re: Newbie contemplating something far too complex?
From: Dave Saunders
Date: Fri, 28 Feb 2003 14:27
Date: Fri, 28 Feb 2003 14:27
24 lines
2127 bytes
2127 bytes
Diane,
I understand your frustration. One of the things I've realized about scripting is that even if one is fairly experienced, it's still easy to get confused and have seemingly easy things bloom out of all proportion.
It does sound as though something is amiss with your system -- that message is something I've never seen.
I'll put a little time into trying to get the script I suggested working, but in the meantime, here are some bits you'll need. I'll assume that you have a selection that allows me to identify the story like this:
tell application "InDesign 2.0.2"
set myStory to parent story of selection
set myList to {}
repeat with n from 1 to count of paragraphs of myStory
copy {n,paragraph n of myStory} to end of myList
end repeat
end tell
return myList
At this point, we have an AppleScript list of lists. If we sort this on the second item of each member of the list, the first item will be automatically sorted and will end up as a list that indicates the order that we need myStory to be.
But first, we must filter out those words you don't care about. The precise method for doing this depends on just what you want to lose and how many of them there are.
If you run the above and then look at the AppleScript Results window you'll see where I'm headed.
Dave
Technical Details
Message-ID:
<1de80f24.10@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de80f24.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,45607331d5b88ff9 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-02-28 06:40:04 PST From: "Dave Saunders" <daves@pdsassoc.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Newbie contemplating something far too complex? Message-ID: <1de80f24.10@WebX.la2eafNXanI> Date: Fri, 28 Feb 2003 06:27:17 -0800 References: <1de80f24.-1@WebX.la2eafNXanI> Lines: 35 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit