Copy link to clipboard
Copied
Hi,
I was wondering if there is a way to replace a hyphen by another character, using a GREP style?
What I want to do is basically replace " - " by " ~ " in all instances, in a certain paragraph style. I could do it by find&replace at the end of my lay-out work, but I was wondering if there is no more automated way, using a Grep Style (or something else)
Thanks for thinking along
Vanessa
1 Correct answer
OutlineG wrote:
What I want to do is basically replace " - " by " ~ " in all instances, in a certain paragraph style. I could do it by find&replace at the end of my lay-out work, but I was wondering if there is no more automated way, using a Grep Style (or something else)
Vanessa
Is there a reason that
• Find dash -
• Change to tilde ~
• when it is a specific paragraph style does not work?
Or AutoCorrect as you are typing?
GREP styles will allow you to assign a character style — not actual text.
A GR
...Copy link to clipboard
Copied
This isn't yet native (as far as I'm aware) and I have been wanting them to make this an official part of the GREP Paragraph Styles for a little while myself.
I can only suggest you add this as a feature request Feature Request/Bug Report Form
I will have a look and see if there's an add on or script that can help in the meantime.
Alternatively - Why is it exactly that it needs to be "~" rather than "-"?
Could you use another font perhaps that simulates this or something?
Forgive my questions.
Best,
EW
Copy link to clipboard
Copied
It's just a design issue - my art director thinks it's nicer this way - but there are a LOT of those hyphens in the description text...
it needs to stay in the font too, do...
Would be a great feature - and fairly simply to add, I would think
Copy link to clipboard
Copied
Hi,
Did you mean "Dash", or changing style of automatic Hyphens?
If you can use the Find/Replace feature, I guess you meant dash.
So, you can easily use a Grep rule if you find a suitable font which has a "tilde-like" dash.
See example below using Goggle Font called "Mr de Haviland"
Now, my first thought went to Autocorrect, as I remembered a great article about Autocorrect and Glyphs (http://indesignsecrets.com/stand-autocorrect-on-its-ear.php ). Although it would't change the auto-hyphen issue.
<wordpair misspelled="-" corrected="~" />
However, we face the problem of Autocorrect feature applying only to entire words.
"Bla - Bla" could easily be changed to "Bla ~ Bla" but not "Bla-bla"
I'd be curious about hearing a solution to that issue... If someone has one...
Vinny
Copy link to clipboard
Copied
it's indeed a dash I meant, not the hyphenation of words...
A different font would work, but I would prefer being able to use the styleguide / initial font...
Copy link to clipboard
Copied
I had a nice idea guys:
GREP it with a char-style, give that char no color, but with underlining in a given color. That could work…
Youll have to emulate the style of your "-"
Copy link to clipboard
Copied
Hi DBLjan, I think the OP wants it the other way around: change - to ~
Copy link to clipboard
Copied
I would prefer being able to use the styleguide / initial font...
Hmmm, in that case, I have no other idea than the Autocorrect feature, assuming someone can come up with an idea on how to disable the "entire word" problem.
I'm sure an XML magician could solve that out...
Copy link to clipboard
Copied
Just had a brainwave!
What if we don't focus on InDesign as the source of the problem and instead focus on the Keyboard for using the straight tilde rather than the wavy...
With this in mind...and I haven't got time to test this...
I propose the use of a key remapping software to temporarily change the output of the tilde key - having looked at these articles:
Map Any Key to Any Key on Windows 10, 8, 7, or Vista
What does everyone think? Could this work for now?
Copy link to clipboard
Copied
If we're going to accept the dificult way, then you could alter your hyphen character in a tilde in a duplicate font using BirdFont (€15).
Copy link to clipboard
Copied
The font edit is a nice way, thou font editors were very expensive. But there are others. And even an OSclassic open-source project.
We had a font, the CEO liked. But he didnt like the 7 not having a stroke. Till I joined our company, my fellow collegues were using the linetool all over 🙂
Copy link to clipboard
Copied
Hi
Did you come up with a solution to your question?
By the way, while going back through this thread, I was wondering if I made myself clear enough about the Grep rule I suggested above:
the special font only applies to dashes, not text. If you work with a serif font, the difference between suggested Goggle font and your tilde will be very slight.. What is the font in use?
Copy link to clipboard
Copied
OutlineG wrote:
What I want to do is basically replace " - " by " ~ " in all instances, in a certain paragraph style. I could do it by find&replace at the end of my lay-out work, but I was wondering if there is no more automated way, using a Grep Style (or something else)
Vanessa
Is there a reason that
• Find dash -
• Change to tilde ~
• when it is a specific paragraph style does not work?
Or AutoCorrect as you are typing?
GREP styles will allow you to assign a character style — not actual text.
A GREP search would work, but would be more cumbersome than a text search.
Copy link to clipboard
Copied
Hi all,
with IndyFont by Jongware and Marc Autret one could easily build a one character font.
And then a GREP style is possible.
Indiscripts :: Getting Started with IndyFont Pro
IndyFont is an InDesign-only solution.
And if you need a one character font only you can get away with the free version:
IndyFont's TRY version offers most of the features of the PRO release, except it will only allow to export a single character per font.
Regards,
Uwe
Copy link to clipboard
Copied
With a grep style … and sun-glasses! Just type a dash! …
Underlining! LOL!
(^/)
Copy link to clipboard
Copied
Also Obi - You've been very helpful in the past
But I'm having a little trouble understanding how you achieved this?
Copy link to clipboard
Copied
Am I on the right track?
Move the Offset a little more and create a character style.
But do you make the dash invisible or delete it or replace it with a fixed space?
Copy link to clipboard
Copied
Hi Jane,
You're right! The dash has "no color"! … but the underlining has "a" color, e.g. as black! not "(Text Color)" [that is, actually, "no color"]!
Simple! Aha! [ Sorry! ]
My previous post was just for fun! (not a very serious way!) I've done better in a recent past!
[Off] A little tired!
(^/)
Copy link to clipboard
Copied
Of course, the invisible dash—I think I've got it now!
And then it's easy to apply the Character style to the dash with GREP. Brilliant solution, Obi-wan Kenobi!
Copy link to clipboard
Copied
😉
Copy link to clipboard
Copied
No, no, no, NO!!!
I don't care if the art director likes the wavy underline instead of a hyphen or en dash (and I hope he/she does), but PLEASE do NOT pretend that it is an actual tilde.
Here is the tilde followed by the wavy line underline applied to an en dash or a hyphen.
It's easy to see that the tilde is a different width as well as a different sine wave.
It's a fun exercise to try to get the wavy line to appear magically under the hyphen, but it is NOT typographically correct!
Copy link to clipboard
Copied
Thanks for all your input, a lot of suggestions were offered here!
As I want to keep my lay-out as clean as possible, I'm not too fond of a different font, and key mapping goes a bit too far for me now... I guess I'll do a simple find and replace a couple of times...
and add a feature request

