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

Script equivalent of Indesign Command

Enthusiast ,
Mar 13, 2025 Mar 13, 2025

Hi

I am looking for a script to carry out following command in Indesign. 

Ctrl + Alt + \     and    Ctrl+Alt+Shift+\   => to increase word space

Ctrl + Alt + Bksp     and    Ctrl+Alt+Shift+Bksp  => to decrease word space 

from selected text. Actually I need an interface where I can change the values and see the result live in the text.

 

Thanks

TOPICS
How to , Scripting
2.4K
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

correct answers 2 Correct answers

Community Expert , Mar 14, 2025 Mar 14, 2025

Hi @Bedazzled532, I have written a script that may help you. Let me know what you think. For instructions, read the script documentation below.

 

Note that it doesn't change "word spacing" per se, because that is a property of a *paragraph*, so instead this script targets the first space after a word boundary and sets its tracking value. To ensure that things don't get too messy, the script will set every word space to the same amount each time you click one of the buttons. I think this will wor

...
Translate
Community Expert , Mar 14, 2025 Mar 14, 2025

Hi @Bedazzled532 I will update the script above with some extra buttons and also some improvements, such as better handling of Undo.

- Mark

Translate
Community Expert ,
Mar 14, 2025 Mar 14, 2025
quote

You want to align the "marker" on the line (white) on the "marker" on the line above (green).

As you only play with a space kerning [see Mark's script], how do you play if you have, e.g., on the line 4 spaces before the marker and 4 spaces after. Modifying the kerning will have no effect unless the last word of the line jumps to the next line or unless the first word of the following line comes on the current line …

 

By @FRIdNGE

You are presuming that you will adjust the spacing the same on both sides of the marker. I don't think that is necessarily true, particularly with fully justified text, as this seems to be.

I can easily see this being successful using @m1b's script on a line by line basis, and I'm impressed that @Robert at ID-Tasker thinks he can do it for the entire document at once.

 

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 ,
Mar 14, 2025 Mar 14, 2025
quote

A right way would be to play with each group of 2 lines [green + white] and move the 2 markers on the median of their horizontal alignment, avoiding of course the words number of each line changes!

 

Like this, just 1 click for 2,000 pages!  😉

 

(^/)


By @FRIdNGE

Perhaps for a change you'd like to actually share your code for doing this?

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
Guide ,
Mar 14, 2025 Mar 14, 2025

No interest for me to write (and share) such a code! Just comments!

 

(^/)

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
Enthusiast ,
Mar 15, 2025 Mar 15, 2025

@FRIdNGE Can it be done using a script? Matching the markers. Manually is taking too long.

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
Guide ,
Mar 15, 2025 Mar 15, 2025

Of course such a very specific matter could be played by Script! …

Just for fun last night, written very quickly and I admit in a totally dirty way:

 

KerningAlignment.gif

 

if time I will try to continue this discussion and a right writting of my script [alas, I don't work for free!]

 

(^/)

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 ,
Mar 15, 2025 Mar 15, 2025

@FRIdNGE

 

Unfortunately, you're making a wrong assumption - in this case, there are no "so nicely" pre-aligned rows - some pieces of text span multiple text rows - so corresponding numbers, won't always be in the adjacent rows. 

 

@Bedazzled532

 

As per my comment above - would be best if you could do pre-alignment manually, then, it would be much easier to implement fine tuning.

 

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
Guide ,
Mar 16, 2025 Mar 16, 2025

Robert, could you post a pdf of the op's sample. Problems with his fonts.

 

(^/)

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 ,
Mar 16, 2025 Mar 16, 2025
quote

Robert, could you post a pdf of the op's sample. Problems with his fonts.


By @FRIdNGE

 

PDF won't by any good.

 

https://community.adobe.com/t5/indesign-discussions/script-equivalent-of-indesign-command/m-p/152096...

 

You can put fonts into "Document fonts" folder, next to the INDD doc - so no need to install them in the system. 

 

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 ,
Mar 14, 2025 Mar 14, 2025

Well, I'm not "playing" at anything. @Bedazzled532 wants to adjust word spacing to align a certain character that appears in stacked alternating language lines. I find that an interesting idea, but wondered whether "fixing" the stacking on one page might make it more difficult to align a following page, and wheter this would be a cascading effect. I don't have a clear answer to that, but the discussion has led to what I consider a useful tool for adjusting word spacing, and @m1b has been kind enough to share his code.

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
Guide ,
Mar 14, 2025 Mar 14, 2025

[Just for comment!] A guy asked me in 2018 for a similar matter but we played totally differently the game (a main flow with threaded text frames through pages [big text] and anchored boxes [small text] with possibility 1/2 lines depending of the small text length).

 

Here what I seem to understand is that, if the op doesn't touch the text on green background [line x], how he could be sure that the line under on white background [line y] is exactly the translation of the line x, aligning the markers he show in his screenshot! … and apparently he will have to adjust each line y manually, on 2,000 pages!

 

Good luck to him!

 

Capture d’écran 2025-03-14 à 17.06.57.png

 

(^/)

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 ,
Mar 14, 2025 Mar 14, 2025

@FRIdNGE

 

I'm pretty sure @Bedazzled532 knows both languages - so will be able to know what's were 😉

 

And yeah - a lot of manual work - but fully automated solution is also possible. 

 

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
Enthusiast ,
Mar 14, 2025 Mar 14, 2025

@Robert at ID-Tasker I can read/write Arabic but dont understand. I can read, write, understand Urdu language. What is the automated solution. Plz share a video, if you have.

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
Enthusiast ,
Mar 14, 2025 Mar 14, 2025

@m1b Thank you so much Mark.

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
Enthusiast ,
Mar 17, 2025 Mar 17, 2025

@m1b Hi! Were you able to update the script for better handling of undos and some extra buttons ? Thanks

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 ,
Mar 17, 2025 Mar 17, 2025

@Bedazzled532 yes the updated script is above. Let me know if you find any bugs.

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