This content has been marked as final. Show 8 replies
On Tuesday 18 November 2008 21:58:35 andrea laue wrote:
> Is there a way to script InDesign to insert the "literal" end nested style
> character everywhere another character (delimiter) has been used to end a
> nested style?
> I want to add the end nested style character, not replace whatever
> character is used to signal the shift in the layout.
i would solve this brutal force:
check every paragraph if nestedStyles are set, check out the delimiter and add
the literal nestedstyle character after
sorry just hit the return button undeliberate.
the suggested solution is probably pretty slow with large doucment and there
is a little hacking to get the nested styles right.
a cool hack would be very nicebut i don't see it in the object model.
Thanks for the reply.
I've written a script that detects nested styles, grabs the delimiters, and searches for instances of those delimiters within a given paragraph. I "grab" the delimiters using the delimiter property of the nested style, which returns either a string or a nested style character enumerator.
The problem is with the latter scenario. I can search the text of the paragraph for a string, but not for the enumerator.
I don't see a way to grab the special character associated with the enumerator -- or to translate the enumerator to the appropriate special character. (The latter could be done by building a lookup table within the script, but I'd like to avoid that.)
The end nested style character is just ASCII character 3 -- you can search a<br />string for that.<br /><br />-- <br />Shane Stanley <email@example.com><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
Thanks for the quick reply.
So my issue is with the delimiters that are NOT the special ENS character. (Perhaps I should have restated that from my previous post in the thread.)
In fact, I need to detect the non-ENS character delimiters so as to insert (and export) an ENS character.
On 26/11/08 10:16 AM, "andrea laue" <firstname.lastname@example.org> wrote:<br /><br />> I need to detect the non-ENS character delimiters<br /><br />You first need to find what they are for each nested style, which means<br />getting the delimiter, inclusive, and repetition values for each.<br /><br />-- <br />Shane Stanley <email@example.com><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
Right. I can get the delimiters, but they're returned as end nested style enumerators, i.e. "1397124194" for the forced line break character.
But searching for "1397124194" won't retrieve instances of the forced line break in the paragraph styled with nested styles.
How can I map the enumerators to the characters in the text? (I'd prefer to avoid making a literal map; I'm hoping the API supports this somehow.)
I guess you're going to have to build a table matching the enumerations to<br />the actual characters, although I'm not sure that's possible with all the<br />enumerations.<br /><br />-- <br />Shane Stanley <firstname.lastname@example.org><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>