Copy link to clipboard
Copied
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
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
...Hi @Bedazzled532 I will update the script above with some extra buttons and also some improvements, such as better handling of Undo.
- Mark
Copy link to clipboard
Copied
@Robert at ID-Tasker I think the result is essentailly the same, but having that panel might make the operation a bit quicker since you can do it all with the mouse.
I have to say that I'm not entirely clear on what the actual intent of the requested script is. @Bedazzled532 has asked for something equivalent to the shortcuts with some sort of live preview (preview is just the actual live reult of running the command), which I think @m1b has done. Are you thinking there is a way to further automate this over the 2000 pages?
Copy link to clipboard
Copied
I think the result is essentailly the same, but having that panel might make the operation a bit quicker since you can do it all with the mouse.
By @Peter Spier
Yes, it would eliminate keyboard.
Are you thinking there is a way to further automate this over the 2000 pages?
Yes.
It would rather be a "brute force" solution - there is no other way - but perfectly doable.
Copy link to clipboard
Copied
I mean 100% automated solution would take day or two to implement - but a manual, 100% keyboard s only olution - was already "ready to go".
Copy link to clipboard
Copied
> Out of curiosity - won't the effect be the same as hitting those original keyboard shortcuts?
Yes! But can you believe that I only just *right now from this thread* learned about that feature! Thanks @Bedazzled532 you have taught me something that will be quite handy! So yes what my script does is the same as the built-in feature (only very slightly different because instead of kerning after the space it tracks the space).
But the idea is to provide a more flexible interface, with customizable values. I made it with a certain idea of how OP is going to use it, but I may have totally missed the mark. In any case, it is a script that can easily be repurposed for other uses so it'll be good to have on hand. Also, it would be easy to add extra buttons for more granular control, for example.
@Bedazzled532 as for automating it over 2000 pages, my script isn't doing that at all, it is a manual helper only, sorry.
- Mark
Copy link to clipboard
Copied
@m1b The word spacing shortcuts are one of InDesign's best kept secrets and I've forgotten who revealed them to me, but it was on this forum many years ago.
Just have to say I loaded the script an played with it a bit (after changing the button direction -- thanks for that switch) and I really like not only that I can leave it open and use the mouse, but that I have multiple levels. It will be a part of my toolbox.
Copy link to clipboard
Copied
@Peter Spier That's nice to hear Peter, thank's for letting me know. I think It's the kind of script that could easily spawn other, similar, tools that operate on different properties, too.
- Mark
Copy link to clipboard
Copied
Actually it makes sense to do the spacing the same as Indesign's way, so I've edited the script above to do it that way.
Copy link to clipboard
Copied
@m1b Thank you so much for this wonderful script. This is actually what I was looking for. The keyboard shortcuts are taking long to show the effect. This script is faster than that. So yeah this is going to work for me.
@Robert at ID-Tasker @Peter Spier Thanks for your efforts also.
@m1b Can there be a text box where we can mention that start increasing space by this value? It would also help.Also there should be one more button with 4 <<<< and 4 >>>> to speedup the process. Or there should be be a button with "x" (x times increase or decrease) How is this idea?
Thanks a ton!!
Copy link to clipboard
Copied
It's great to hear, that this script would help you.
But if I may.
I was just thinking and if you don't need fully automated solution - as I've mentioneed in my other post, you could get the same effect with my IDT - but it should be a bit more handy - and completely free.
As per the screenshot above (*) - all texts in between numbers can be loaded into IDT. Most likely a better GREP expression would be needed.
Then, you would've to create a few simple Tasks - free version of IDT won't let you load more than one - and just use up / down arrows to switch between found results (*) - IDT will automatically select corresponding text, including switching pages - and expand / contract texts using keyboard shortcuts assigned to those Tasks.
Of course, each Task can do whatever you want - just invoke those built-in keyboard shortcuts - or set / increase by whatever values you wan't.
And, the same as in the InDesign - you can use Ctrl / Shift / Alt modifiers to use the same base key - with different "step values".
100% mouseless solution 😉 so should be much quicker 😉
And, if at any point, you would need to select only part of the original text (*) - when it spans multiple lines, but manipulating all lines at once won't get you correct result - or you simply don't want to "touch" them - and you would need to select only one last line of the selection - you can create additional Task, that will select first or last line, assing a kyboard shortcut - and still avoid using mouse.
(*) screenshot shows the last (*) I'm mentioning - all found results has been already split into separate lines.
But it's not the end of the world 😉 because, when working in IDT - when user use SHIFT and up/down arrows - IDT will automatically select BOTH "objects" on the list - as loong as it's possible - pieces of text, objects on the same spread / within group, cells in the Table. Of course selection can be expanded to further elements on the list.
Copy link to clipboard
Copied
@Robert at ID-Tasker Thanks. A sample video with my example will be helpful and easy for me to understand. It sounds good that all of this can be done without mouse.
Copy link to clipboard
Copied
@Robert at ID-Tasker Thanks. A sample video with my example will be helpful and easy for me to understand. It sounds good that all of this can be done without mouse.
By @Bedazzled532
As you wish 🙂
Just to show a general "modus operandi" of ID-Tasker - exactly the same techinique can be used for navigating though the document - be it Texts, Objects, Tables / Cells, etc.
And this functionality - is 100% Free of Charge.
Copy link to clipboard
Copied
@Robert at ID-Tasker I would like to give it a try free of charge.
Copy link to clipboard
Copied
@Robert at ID-Tasker I would like to give it a try free of charge.
By @Bedazzled532
There are versions for CS6, CC2024, CC2025.
Attached is main Task and all "supporting" Tasks and XML for GREP.
As I've mentioned earlier - free veersion won't allow you to load more than one Task - so you'll have to load the main one and then create the supporting ones manually every time - but it's just a few clicks 😉
Here is path for GREP query:
C:\Users\[YOUR_USER_NAME]\AppData\Roaming\Adobe\InDesign\Version 20.0\en_GB\Find-Change Queries\GREP
Or, after you install IDT - please send me HFP - privately - and I'll send you temporary activation key.
Copy link to clipboard
Copied
Most likely, you'll have to ask some of the GREP gurus here to help you create a better GREP query...
Copy link to clipboard
Copied
@Robert at ID-Tasker Your grep query seems fine. It selects the correct sentence as I saw in the video you shared. If required, I will post about the grep query as well.
Copy link to clipboard
Copied
@Robert at ID-Tasker I have downloaded v2025 and the xml and text files. On installing, it gives error that ID2025 not found. How to deal with it ? I have saved the downloaded files in a separate folder under my D drive.
Copy link to clipboard
Copied
You'll have to run IDT as Administrator to let it register InDesign in the system.
I'll send you a message privately.
Copy link to clipboard
Copied
Just added a new functionality - still available in the free version:
Red - is the "marker".
Blue Task - will select text before the "marker".
Yellow Task - will select text after the "marker".
As this is Right-To-Left text - it's of course reversed 😉
The other Tasks, posted before - remain the same - as they just work on the selected text.
So in the end, there can be 6x Tasks - 2x to select text before/after and 4x to change its properties - or the "blue" and "yellow" Tasks can be integreated with those earlier Increase/Decrease Tasks - and add 4x more Tasks - where each would select text first - before or after the "marker" - and then increase or decrease word spacing - so 8x Tasks in total.
And because only markers are referenced - then even if they'll move because of the changes made to the text before - correct text before / after and to the beginning / end of the TextLine will always be selected.
Copy link to clipboard
Copied
Forgot to mention - in order not to "flicker" screen when switching between the rows on the list - you will have to use Ctrl / Alt / Shift + Enter - different combinations - to show just the selection / page / spread / zoom in / zoom out - when the new selection is not on currently active page - or your current zoom level is too high.
Copy link to clipboard
Copied
Hi @Bedazzled532 I will update the script above with some extra buttons and also some improvements, such as better handling of Undo.
- Mark
Copy link to clipboard
Copied
Sorry but I don't understand clearly what you* are trying to play!!!
Somebody could clearly explain me in a few words. Thanks.
[* the op, Peter, Robert and Mark]
(^/) The Jedi
Copy link to clipboard
Copied
OP has two Stories - different languages - both have numbers in the text - and he wants to align position of those numbers - by expanding / contracting surrounding text - but only in one Story.
Copy link to clipboard
Copied
@Peter Spier @Robert at ID-Tasker @FRIdNGE @m1b There is one more thing which I think I should clear. This may help to find a better solution.
The text in Green Box (Arabic), it has circles with numbers in it. That circle is known as "Ayat". Its unicode is \x{6f0}\x{6f0} two times. Numbers has separate unicode values AND the text in white box (Urdu), the one which I want to adjust, this also has a circle with numbers in it. Its unicode range is from \x{E17C} to \x{$E29A} including the numbers. I hope I am able to explain this point. Long story shoft, Arabic is fixed, urdu circle needs to be aligned with arabic circle. @m1b has done a great job. I am using his solution until I get a better solution.
Copy link to clipboard
Copied
Just a comment:
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 …
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! 😉
(^/)
Copy link to clipboard
Copied
@FRIdNGE Seems logical. Both groups can be played BUT there is one more condition. The Arabic and Urdu should not take odd number of pages and it should finish at the end of the page and not half or quarter of the page. Whts the solution to that ?