Punctuation stack

Guide ,
Feb 26, 2011 Feb 26, 2011

Copy link to clipboard

Copied

Hi,

My indesign document have lot of paragraph. My client dont want word and punctuation stack. That means, we dont want three same character, hyphens... So what i do is giving trackin/kerning or giving non-breaking space to avoid this stsck.

Is there any way to control this through script?

Also is there any way to control loose/tight line?

Thanks in advance,

Karthi

TOPICS
Scripting

Views

2.7K

Likes

Translate

Translate

Report

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

correct answers 1 Correct Answer

New Here , Dec 10, 2015 Dec 10, 2015
Not sure why no one knew what you were trying to achieve but I have the answer for you. Here you go.https://indesignsecrets.com/free-script-identifies-word-stacks.phpThis resolves word stacking.

Likes

Translate

Translate
LEGEND ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

I don't know what you are asking. If you don't want more than a certain number of consecutive hyphenated words, that can be set in the Hyphenation settings using "Hyphen Limit".

Harbs

Likes

Translate

Translate

Report

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
Guide ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Hi Harbs,

Thanks for your reply. Actually i mean, i dont want three consecutive hyphen or character or punctuations at end opf word in a paragraph. We can set hyphen limit in indesgn. But my requirement is different.

For example, Pls take alook at below screenshot,

Test.jpg

I dont want this kind of things. What i do, i give tracking or use non-breaking space to avoid this. Is it a javascript which to find this kind of instances and highlight? If possible it will give non-breaking space to first or secong word?

Thanks,

Karthi

Likes

Translate

Translate

Report

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
Advisor ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Try enabling "Optical Margin Alignment" in Story panel.

It enables punctation and hyphens to go outside text frame.

--

Marijan (tomaxxi)

http://indisnip.wordpress.com/

http://inditip.wordpress.com/

Likes

Translate

Translate

Report

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 ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Thanks for the screenshot. It made what you wanted much more clear. It wasn't really possible to understand from your original question.

I do not think Optical Margin Alignment is what you want.

You want to adjust the tracking and breaking of the paragraph such that these "stacks" do not occur at the last character.

It is certainly possible to do this with scripting. But you are not likely to find a canned solution -- you will need to learn and write it yourself.

Do you know Javascript, or have any experience scripting InDesign whatsoever? You'll need that.

To get started, you need to decide on a very clear sequence of steps that would be taken to identify and address this problem.

I would start by turning on the Single-line [paragraph] Composer, so that a change you make at the end of the paragraph will not affect the beginning of the paragraph.

Then you must loop over the lines of the paragraph, and remeber the last line that it is safe to change tracking in, and check to see if you have a stack. If you find a stack, then go back to that last safe line and start adjusting the text's tracking to remove the stack. You'll have to define some tolerances. They will depend on your type of text. At our newspaper, we track between -15 and +15, but that may not be appropriate for you. Once you've removed the stack,

you need to check and make sure you have not inadvertatly created a ne wstack.

Once you succesfully adjust the tracking to remove the stack, then you should reset the safe line counter to the next line following your stack, and then keep searching for more stacks.

Is that what you want to do? I guess the above algorithm might not work if you have a case of two overlapping stacks. Where lines 1-3 form a stack, and when you fix them, lines 3-5 form a stack, and when you fix them, lines 1-3 form a stack a swell. So you'll have to be careful.

But anyhow, first figure out the algorithm, then implement it in JavaScript. Which part do you need help with?

It would also help if you were VERY clear in your english, because it can be hard to understand you.

Likes

Translate

Translate

Report

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
Advocate ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Can someone draw Big Red Circles on the offending positions? I still don't get it. Only thing I see -- dark gray text on a black background, ugh! What were you thinking? -- is a "stack" of consecutive hyphens, and those can and will be affected by the Consecutive Hyphen option that has been mentioned twice.

Likes

Translate

Translate

Report

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 ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Jongware, you have to click on his image, the forums are cropping it; and it's a CMYK JPEG. Or try this one:

Test-c.png

Anyhow, the problem is a vertical stack of hyphens or other characters at the right margin.

Likes

Translate

Translate

Report

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
Advocate ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Ah -- Mac Preview Strikes Again. This is what I see:

Screen shot 2011-02-28 at 2.32.57 AM.png

(So, next to Tip #1, which is "an image of reasonable size", let's add Tip #2: "No CMYK JPEGs.")

Still, I don't see "the problem". The top circle (barely visible, on my screen) shows three consecutive hyphens, and the bottom one shows one single hyphen. That hardly counts as a "stack", doesn't it?

I still don't get what "other characters" is referring to.

Likes

Translate

Translate

Report

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 ,
Feb 27, 2011 Feb 27, 2011

Copy link to clipboard

Copied

Surely its visible in my version?

Anyhow, the problem is a stack of OTHER characters in the last example. The letter 'o', in this case.

Likes

Translate

Translate

Report

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
Guide ,
Feb 28, 2011 Feb 28, 2011

Copy link to clipboard

Copied

Hi,

Thanks for everyone who spent time for reply my question. Really sorry maybe my english is bad. Now i want to explain clearly what i exactly what.

screen 1.JPG

screen2.JPG

screen3.JPG

The above screen shots show the stack, my hyphenation and justification settings.

I want a javscript which will do the following process. (i don't know how to write javascript)

1) Javascript find end character of a paragraph. If it have same character, it will apply non-breaking space to the second word. Example, in screenshot 1, the nonbreaking space should apply in between words 'extreml' and 'and'. So the stack will eliminated. If it will create loose line then i take a look and give tracking. As per my client he don't want to apply tracking for a single line. If i want to give tracking, then i will give it to whole para.

2) If the above one is not possible, then javascript will find the stack and atleast give a color, then we can easily look where it is.

Maybe this will help you. I am eagerly waiting for your answers. Please help me regarding this issue. It will make a bit pain to me.

Thanks,

Karthi

Likes

Translate

Translate

Report

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 ,
Mar 01, 2011 Mar 01, 2011

Copy link to clipboard

Copied

OK, so have you tried to learn scripting? You should give it a shot! It seems like the kind of thing where you will have to do a lot of fine-tuning of the scripts, so it's important that you understand what you're doing.

This is not a case where you can run the script once and forget it...

Likes

Translate

Translate

Report

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
Guide ,
Mar 01, 2011 Mar 01, 2011

Copy link to clipboard

Copied

Hi John,

One of my friend told me this can be done by script. I don't want to learn javascript. It is so complex for me. I just want a solution, if i am not get it okay. I will continue my manual working......

Likes

Translate

Translate

Report

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
New Here ,
Dec 10, 2015 Dec 10, 2015

Copy link to clipboard

Copied

Not sure why no one knew what you were trying to achieve but I have the answer for you.

Here you go.

https://indesignsecrets.com/free-script-identifies-word-stacks.php

This resolves word stacking.

Likes

Translate

Translate

Report

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
Guide ,
Dec 10, 2015 Dec 10, 2015

Copy link to clipboard

Copied

HI Books,

Thank you so much. It helps me to get some solution now.

Karthi

Likes

Translate

Translate

Report

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
Contributor ,
Aug 20, 2016 Aug 20, 2016

Copy link to clipboard

Copied

Hi TPK,

I need your help TPK,

Sorry for asking this.

Your completed for above script?

I have some doubt TPK.

Thanks

KS

Likes

Translate

Translate

Report

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
Contributor ,
Aug 21, 2016 Aug 21, 2016

Copy link to clipboard

Copied

Hi TPK,

Any updated?

Thanks

KS

Likes

Translate

Translate

Report

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
Explorer ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

LATEST

Does anyone happen to know if theres a similar script available that does not rely on character styles? My documents often include multiple scripts, so I rely highly on character styles already and can't allow a script to possibly override the cstyles I've already applied.

 

I've been trying to write something similar, but I'm very new to Javascript and am finding the transtion from VBA to Javascript to be frustrating. What I've been trying to do in my version is to work forward from the cursor looking for two lines starting or ending with the same nonwhite-space glyph and then just highlighting one or both of them. It's not really that important to me that the script be particular about the kind of stack it finds—all stacks that I'm looking for would be caught by looking for two stacked nonwhite-space glyphs. And I don't have any problem working through the document as the script finds stacks rather than having the script find all of them at one time. I do "find next" searches all the time, and the script I'm imagining—once attached to a keyboard shortcut—would not be much different.

Likes

Translate

Translate

Report

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