Re: Sequential renumbering in InDesign CS3
Re: Sequential renumbering in InDesign CS3
- Subject: Re: Sequential renumbering in InDesign CS3
- From: Shane Stanley <email@hidden>
- Date: Fri, 05 Dec 2008 18:26:05 +1100
- Thread-topic: Sequential renumbering in InDesign CS3
On 5/12/08 6:08 PM, "Andrew Brown" <email@hidden> wrote:
> On 5 Dec 2008, at 08:02, Shane Stanley wrote:
>
>> On 5/12/08 1:41 PM, "Andrew Brown" <email@hidden> wrote:
>>
>>> The only way I can find the digits and letters is by character style
>>
>> Are they applied directly, or via a nested style?
>
> Directly. The name of the style can vary from project to project, we
> could either edit the script or ask it to pop up a list of character
> styles from which we select the one applicable.
Searching based on character styles is a bit roundabout because the find
text preferences object's applied character style property requires a
reference to a style, but being at the application level, it won't accept
references to styles belonging to documents. So the workaround is to make a
temporary application level character style of the same name, use that in
the find, and delete it if necessary.
So a starting point would be this:
set theStyleName to "Whatever"
tell application "Adobe InDesign CS3"
set find text preferences to nothing -- reset to defaults
try
set theStyle to character style theStyleName
set existsFlag to true
on error
set theStyle to make character style with properties
{name:theStyleName}
set existsFlag to false
end try
set properties of find text preferences to {applied character
style:theStyle}
repeat with i from 1 to count of stories of document 1
set theFinds to find text story 1 of document 1
repeat with j from (count of theFinds) to 1 by -1
set contents of item j of theFinds to (j as text)
end repeat
end repeat
if existsFlag is false then delete theStyle
end tell
--
Shane Stanley <email@hidden>
AppleScript Pro Florida, April 2009 <http://scriptingmatters.com/aspro>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden