Forum Replies Created
-
AuthorPosts
-
Theunis De Jong
MemberThen you have *two* problems …
First off: GREP Styles cannot help you with this, in any way. They CANNOT apply a paragraph style, and they CANNOT apply or check anything outside of their own paragraph. They live in a small, one-paragraph-sized world of their own.
Second: alas, your suggested GREP wouldn’t work either! The basic idea would look like this:
CHAPTER \u+\r.
(the last full stop is important!) Other than my example above, this now also contains ‘all uppercase, any number of them’, so it can match ‘ONE’, ‘TWO’, and ‘THREE’; and if you try it, you will see it grabs a chapter plus number, a next hard return, and a single character of the next paragraph. Should you apply a paragraph style now, then it gets applied to both paragraphs.
But you only want to grab the second, so that’s why you suggested a lookbehind (that’s the part I initially missed). Moving the part before the to-be-adjusted paragraph into a lookbehind, you would get this:
(?<=CHAPTER \u+\r).
and this *ought* to find a single character, with ‘CHAPTER’ (etc) on the line above. But it does not work! The reason is your capitalized numerals have different lengths — ‘ONE’ is 3 characters, ‘TWO’ also 3, and ‘THREE’ has 5 — and a lookbehind cannot test for a variable length of characters. This is just too complicated for a single GREP.
A possible (and tricky) solution is to do multiple tests, each one with a fixed length:
((?<=CHAPTER \u\u\u\r)|(?<=CHAPTER \u\u\u\u)|(?<=CHAPTER \u\u\u\u\u)).
will work for ONE up to TEN (for ELEVEN and/or TWELVE you need to add a 6-uppercase check, after that 8, and so on and so forth).
Theunis De Jong
MemberNo need for a GREP, you can search for “CHAPTER” with a regular Find/Change. (Mind to check both “Case Sensitive” and “Whole Word” boxes. (Also mind to *uncheck* them when you’re done, as that is the default state everyone is used to.))
Can you explain what the lookbehind part was supposed to do? You can search for ‘ONE’ with “CHAPTER” in the lookbehind like this:
(?<=CHAPTER )ONE
… but I don’t see any advantages in this. Since you are applying a paragraph style, there is no need for a lookbehind (or lookahead, for that matter), because what you are looking for *is* in the same paragraph.
October 14, 2013 at 3:02 am in reply to: How can I keep hyper links intact when I run the sortparagraph script? #65754Theunis De Jong
MemberUse “Retain Formatting”, even though it is slower. Hyperlinks *are* a form of formatting.
August 28, 2013 at 2:38 am in reply to: Grep to choose first letter of every word in paragraph #65067Theunis De Jong
MemberKimmi, very good, you had the same idea I had — except for two small nitpicks that chrisl overlooked :)
1. I copied chrisl’s question to use as test text, and it starts with the word “I”. Since it doesn’t appear in the list of ignored words, it should be marked — but this GREP always needs at least *two* characters.
2. It is ignoring *any* first character, when followed by the 2nd to last characters of the To Ignore list. So “?rom” is to check for “from”, but it will also ignore “prom”; “?hat” will ignore “that” but also “chat”, and so on.
The following uses the same idea, but with these points corrected (I also prefer for word break, for no special reason at all):
(?!(for|of|the|and))[\u]
and if capitalized words need skipping as well, add the Case Insensitive switch at the front:
(?i)(?!(for|of|the|and))[\u]
Oh, and to check *any* first letter, all it takes is this:
[\u]
Theunis De Jong
MemberWith the global update of the entire forum some links appear to be broken. The correct download link to the script is
https://creativepro.com/downloads/forcedl/stateAbbreviations.jsx
Theunis De Jong
MemberLevi, if your checkbox is a simple black-and-white vector image, you might want to use this:
https://creativepro.com/creating-a-custom-bullet-or-character-with-indyfont.php
Having a custom bullet character font for your checkbox means that you can “insert” it through InDesign’s Bullet & Numbering option, and that in turn means that (a) you can store it inside a paragraph style, and (b) add it to your text by applying this style to any line.
Theunis De Jong
MemberAFIK (Away From InDesign Keyboard) at the moment, but you can try this:
\d(?=(\d\d\d)+(?!\d))
instead of Masood’s \d(?=(\d\d\d)+\D)
In essence, it means the same — a digit followed by 3 digits followed by NOT a digit — but there is an essential difference. “\D” is “a character which is not a digit”, but “(?!\d)” means “not a digit”. That last one is also true if *nothing* follows :-)
Theunis De Jong
MemberDavid: puurprint wrote “No problem for the automatic page numbers as digits, but the page numbering as text was just placed manually on each page?”
I interpreted this as, “wot, this software has no automatic page numbering like Word does? oh well, let’s see what is easier: look in the Help or type them all…” :-D
Theunis De Jong
MemberWould it not be easier (= less work ;-) to *remove* the manually entered page number and replace them with the regular Page Number code? You only have to copy the Page Number Here code once; then you can paste it on every page.
(Technically better would be to entirely remove the old page number text frames, and create them a-new on the original master pages. But that may interfere with other pages as well.)
Theunis De Jong
MemberOh that’s deviously clever!
Theunis De Jong
MemberParagraph styles cannot remove text. (Nor add it — Space Above and Space Below don’t ‘add’ text.)
Best to use a GREP search-and-replace, because the regular Find/Replace may mess up paragraph styling. Search for this:
(?<=\r)\r
and replace with nothing. This simply looks for a paragraph return which is preceded by another, and removes only the second one.
Theunis De Jong
MemberClair, it’s possible to exclude entire phrases out of an otherwise “catch-all” GREP query, but you have to list each one of them.
You can try this:
(?!(Assistant|Chief))(\u\w+ \u\w+)
This ‘looks ahead’ for either “Assistant” or “Chief”, followed by a word break — the break is to prevent the Chieftains Museum, Rome, Georgia, being ignored. (A somewhat constructed example I admit, but you SHOULD check for entire words, just in case.)
I THINK you only need to check the first word here; in the case of your “Assistant Chief”, the “Assistant” is the one that gets ignored right away and ID will not contemplate “Chief”, unless it is followed by yet another capitalized word. And then “Chief” and that word in turn are ignored, unless there is a FOURTH capitalized word following (in which case only the two last words are found, as presumably is the intention here).
Theunis De Jong
MemberAlas. All that the blog says is that “some scripts may be broken” — it doesn’t offer a solution, other than waiting for Adobe’s promise to fix things “as soon as possible”.
From your brief description, it seems INX is no longer supported. Inserting formatted text right into a document is horribly slow, so markdownid converts a markdown file to INX, and then reads this into your current document.
That reminds me, hold on while I check.
..
Yup, InDesign CC’s Top New Features still lists “greatest improvements in speed and stability when printing and when exporting PDF and INX files”. So apparently they only broke IMPORTING those INX files.Theunis De Jong
MemberThis had me scratching my noodle, but I bet you are spot on, David!
STEVE, ‘language’ is only an attribute, just like ‘font’ and ‘size’ and ‘color’. Changing it to another changes the way InDesign hyphenates the words, changes the default single and double quotes (only when inserted a-new), and in some fonts may render a few characters slightly different. It certainly does NOT “translate” text.
Theunis De Jong
MemberDo you mean by that it doesn’t work?
I don’t have (nor *want*) CC so I cannot try, but if you get an error message, post what it says and I’ll try some Remote Debugging.
-
AuthorPosts
