Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Fixing Rule in Indesign

Community Beginner ,
Nov 28, 2016 Nov 28, 2016

Hi All,

Is there any way to fix the rule adjustment in indesign paragraph stye rule option if the text increase or decrease automatically.

Right now i am working manually given the tab character and apply one character style for this. See below screenshot for reference.

Screen Shot 2016-11-28 at 2.20.11 PM.png

Thanks for looking this.

Kasi

3.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2016 Nov 29, 2016

It would be possible to apply the style via a script and enforce two spaces (or tabs) at the end, so you would have to touch the keyboard.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2016 Nov 29, 2016

Hi Obi-wan,

cool trick.

Using a tracking value of 10000 and horizontal scaling with 1000% together with a colored underline for a space at the end of a paragraph.

However, I would write the GREP a bit different to make it more clear that there is a space in the expression:

\K\x{0020}{1}$

Fully automating this?

Would require scripting an event listening mechanism.

But I guess, that could slow down editing the text tremendously…

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 30, 2016 Nov 30, 2016

Hi Uwe,

So, here:  (\x{0020})\K\1{1}$

(^/) 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2016 Nov 30, 2016

Would require scripting an event listening mechanism.

I was assuming a script could be used to apply the style, so a simple script with a key command could enforce the ending white spaces (either a right indent tab with an underline or Obi's spaces) and then apply the style. In that case you wouldn't need a listener or even a Grep style.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 30, 2016 Nov 30, 2016

Hi Rob,

I don't think in that way!

No tab, no space! Just a para rule below.

I took a look to this question. I think it could be very simple to script:

After defining a para style with a "column" para rule below and "left indent" by default equal to zero and applying everywhere [Op's work],

the script just search all the paras with this para style, save the x-offset of the last char of each para [of course, on the last line!] and update the "left indent" of the para rule below! ( some math to do!  ]

It's not an automatic way, but I find it cool! 

(^/)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2016 Nov 30, 2016

and update the "left indent" of the para rule below! ( some math to do!   ]

But then I think any future edit would alter the column width and you would have to rerun the script right? The right intent tab is designed for this kind of thing, so I'm not seeing a compelling reason to avoid it when a script could easily insert the needed tab at the end as the style is applied.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2016 Nov 30, 2016
LATEST

Here's an Applescript example, edit pstyle and whitespace variables as needed. Note that AS lets you copy and paste right intent tabs and other white spaces from ID but you can't see them in the code.

--------------------------------

--name of style to apply

set pstyle to "Your Style"

--the desired trailing whitespace.

set whitespace to "     "

tell application "Adobe InDesign CC 2014"

    tell active document

      

        --in case more than 1 paragraph is selected

        set p to object reference of every paragraph of selection

        set c1 to index of character 1 of item 1 of p

        set c2 to index of last character of last item of p

      

        --get the text of all the paragraphs and search. need repeat below to add space in case there is nothing to find

        set tf to object reference of text from character c1 of parent of item 1 of p to character (c2 + 1) of parent of item 1 of p

        my GrepSearch(tf, "[\\s]+$", "")

      

        --reverse repeat because the edits change the text flow

        set ns to object reference of every paragraph of selection

        repeat with a from (count of ns) to 1 by -1

            set c to item a of ns

            set contents of insertion point -2 of c to whitespace

            set applied paragraph style of c to pstyle

        end repeat

    end tell

end tell

--strip the white space from end of paragraphs

on GrepSearch(t, f, c)

    tell application "Adobe InDesign CC 2014"

        set find grep preferences to nothing

        set change grep preferences to nothing

        set find what of find grep preferences to f

        set change to of change grep preferences to c

        tell t

            change grep

        end tell

    end tell

end GrepSearch

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines