Forum Replies Created
-
AuthorPosts
-
Theunis De Jong
MemberSet the Gap color:
Theunis De Jong
MemberThe first line inside the loop sets a random baseline shift. Following the formula, it seems this sets either 0 or 1, nothing else. In your case, you want −1 to +1 and all values in between. So try this line instead:
app.selection[0].characters[i].baselineShift = 2*Math.random()-1;
The real question everyone will want an answer to … What is a “crawl”? :)
October 25, 2012 at 2:39 am in reply to: Creating a broadside – How to make line widths equal, with multiple text sizes? #63452Theunis De Jong
MemberThe script helps, but finding a nice combination of font and size for each line sure is an interesting exercise!
October 25, 2012 at 1:44 am in reply to: Creating a broadside – How to make line widths equal, with multiple text sizes? #63450Theunis De Jong
MemberYou might want to familiarize yourself with the default “1 point larger / 1 point smaller” hotkeys: Ctrl+Shift+<, Ctrl+Shift+> — “Cmd” instead of “Ctrl” on the Mac.
Also note that your example does not have all of its lines fully filled (and is this a historical example? it contains a typo: 'Achinng')
But to get you started
here is a little Javascript, cobbled together in a few minutes. Select a text frame and run the script to make each paragraph fit on a single line. It works on each paragraph, separated by hard returns. It depends on the number of lines inside a paragraph, so it does not work at all with forced line breaks (Shift+Enter): no matter how small the type gets, the text would never 'fit' on a single line!if (app.selection[0] instanceof TextFrame)
{
par = app.selection[0].paragraphs;
for (i=par.length-1; i>=0; i-=1)
{
fit_unto_line (par[i]);
}
}function fit_unto_line (a_par)
{
if (a_par.contents[0] == 'r' || a_par.contents.indexOf('n') >= 0)
return;var halve = a_par.characters[0].pointSize/2;
while (halve > 0.05)
{
while (a_par.lines.length == 1)
a_par.pointSize += halve;
halve /= 2;
while (a_par.lines.length > 1)
a_par.pointSize -= halve;
halve /= 2;
}
}Theunis De Jong
MemberChuck, InDesign's flavor of GREP cannot change uppercase to lowercase. Using a character style, you can change lowercase to uppercase only because “Capitals” is a text attribute — it does not change the actual text, as you can see by copying and pasting it into the Find What field, for example.
Theunis De Jong
MemberThe best all-around guide is Peter Kahrel's O'Reilly Shortcut on GREP for InDesign: https://shop.oreilly.com/produc…..6156015.do
But the very short version: b is a word break, u stands for a single uppercase character, l for a single lowercase character. InDesign's GREP even recognizes Greek or Cyrillic uppercase and lowercase characters as such (not that I think Greek names to pop up in your articles — George Michael doesn't count! he's spelled in Latin!)
The '+' means “one or more of the preceding code”, so something like l+ means “one or more lowercase characters). The parentheses group stuff together in a functional unit; (ul)+ means “find one uppercase, then one or lots of lowercase characters; repeat this unit as much as possible”. As you see, GREP is quite concise compared to English :)
Theunis De Jong
MemberWhat you ask is certainly possible, and in (at least!) two different ways. First, you can use GREP to search for this
bul+ ul+b
and manually apply bold (or put “Bold” in the Change To formatting field, and use any of the Change/Change Next/Change All buttons).
Second, a way faster method, by adding a GREP style to your paragraph style. You can use the same GREP for this; all names will automatically be bolded.
If you may have three or more names (“David Lee Roth” comes to mind :D), use this GREP:
bul+( ul+)+b
There is a possible problem, though. It is right there in your example! “Singer Mick Jagger” — that's three capitalized words in a row, but the “Singer” is not part of a name. If you manually apply your bold, you can always adjust it later on, but when you want to use a GREP style you're pretty much stuck to it. Depending on your text, you could try this
(?<=.)bul+( ul+)+b
which will ignore the very first word, even if it starts with a capital. You can even tell GREP to ignore the specific word “Singer”:
(?!Singer)bul+( ul+)+b
.. but perhaps you also have a “Singer/songwriter”, a “Musician”, “Guitar Hero”, or “Ex Genesis Drummer and Singer” ..
Theunis De Jong
MemberTheunis De Jong
MemberNo. Alas.
… well. The only way I can think of is to ignore the existing note numbers altogether, and supply your own — entirely manually. Hide the ones in your text by setting its color to [None] and its size to 0.1 pt. Insert your own superscript numbers in the text and in the note itself. It'll be hell to update, though.
Please complain to Adobe about this, and other Footnote Related Issues here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Perhaps this will get addressed in the next version of ID, rather than yet even more e-pub options, a straight conversion to HTML5, and an integrated web page/CSS editor.
Theunis De Jong
MemberTo get a single backslash in this editor you have to type two: \ (and thus I actually had to type this '' to make 'em both show up :) )
Back to your problem. Your GREP query works fine; it will accurately find the period inside “itle:(en-dash).(return)”. The problem is, you have some more text between your 'title' and that period — your 'bunch of characters' — and you forgot to include those in your search.
So you need to add a wildcard match to skip the actual title data. One would assume this to work:
(?<=itle:~>.+).(?=~b)
but it doesn't: a Lookbehind needs to have a fixed length, you cannot use any of the variable length specifiers (the '+' here). Most dialects of GREP do not support variable length lookbehinds — things get too fast too complicated if this is allowed.
So a workaround is needed here: find “Title”, sentence, period, and replace with just “Title” and sentence.
[ A propos, a better way of testing for 'end of paragraph' is to use the end-of-paragraph specifier '$'. Your '~b' matches the hard return at the end, and so you had to find a way to preserve it. The '$' on the other hand matches end-of-paragraph without 'selecting' the next hard return. ]
This ought to work: search for
(itle:~>.+).$
and replace with
$1
Theunis De Jong
MemberThe github script is the one I modified as well. I only tested a few simple queries, but it seems there is only one place in which it goes wrong with CS6.
I need to come back in life as Theunis.
Hmm :) There is barely room inside me head for one person!
Theunis De Jong
MemberPerhaps the problem lies not in the document but in your local fonts. If one got damaged somehow (it's always a mystery to me how something like that could happen!), InDesign will appear to work correctly right until it needs that font.
Even though the foundations of Adobe are firmly fixed into font creation, InDesign cannot work with a Bad Font, and rather than issuing an error message, it crashes. Hard.
If you know what fonts are used in the document, remove them (unless they are “system fonts”, in which case you would break even more) and see if InDesign opens your document. Of course it will complain there are some fonts missing, but if it does not creash, you know the cause. Only problem at that point is to find the original files for your fonts.
Theunis De Jong
MemberTry with this modification to Martin Fischer's original “RecordFindChange.jsx”: add
s = s.replace(/^r+/, '');at the 26th line, right before the comment that reads
// column or single lineIt seems something infinitely small changed inside the Find/Change dialog, making it return just a tiny bit different result …
Theunis De Jong
MemberUse Find/Change. Leave the text fields blank, but put something in the Find Formatting that you are sure is applied to every individual paragraph — even if it's something rare, such as a baseline shift of 0 pt. In the Change formatting field, set your text jusrification. Then use Change all, with the scope set to “Document”.
September 24, 2012 at 8:45 am in reply to: GREP search string to look for "incomplete" italics? #63223Theunis De Jong
MemberYou cannot search for mixed attributes using GREP. The inverse might work, though: search for punctuation in Regular with 'nothing' (i.e., not-Regular) before it.
Try this: search for
(?<!.)[[:punct:]]
with “Regular” in the Find Format style field.
-
AuthorPosts
