Forum Replies Created
-
AuthorPosts
-
Peter KahrelParticipantAre you sure they want INX? That would mean they’re still using CS3. If they use CS4, 5, 5.5, or 6, you can export your file to IDML, which your customer can then open in their version. If they really want INX, then you’ll have to export your file to IDML, then open the file in CS4 and export it to INX from there.
Peter
Peter KahrelParticipantFor me the ideal behaviour would be that if the screen shows the full spread or page, Find doesn’t change the position. But when you’re zoomed in, find should centre the result. Should be an option.
Peter
Peter KahrelParticipantTo make text disappear, add a character style and name it e.g. ‘hide’. Set the point size to 0.1 and the horizontal scale to 1%. And for good measure set the colour to Paper. Then define two GREP styles in the paragraph style(s) using the ‘hide character style:
^\[E\d:
^.+?\]The first one hides [E1:, [E2:, etc, the second one hides the first bracket in the paragraph. This assumes that the first ] in every paragraph is the closing bracket of the code.
As to conditional formatting, you could look into conditional text if you want to maintain two texts in one document.
Peter KahrelParticipantNoel,
It’s going to be tough to change that with GREP, if it’s at all possible. Why don’t you mark up the text with index entries, so that when you generate the index you get the desired output?
Peter
Peter KahrelParticipantHere’s a script that, if the current selection is a text frame, places the cursor at the first insertion point:
if (app.documents.length > 0 && app.selection.length > 0 && app.selection[0] instanceof TextFrame) { app.selection[0].insertionPoints[0].select(); }You can assign it to a shortcut key.
Peter
Peter KahrelParticipant. . .
it is then! Thanks!
Peter KahrelParticipantWell, why it didn’t work earlier with those quotes I don’t know. Seems to work fine, David, thatnks for trying that.
Indents have to be done with non-breaking spaces: as normal spaces and tabs don’t work.
Peter KahrelParticipantAnothertest. . .
I am typing text with "straight quotes" inside this 'code tag'
Pasted things:
xxx "xxx" xxx 'xxx'
indent with nobreaking spaces
indent with spaces
indent with tabs
Text
September 24, 2015 at 7:38 am in reply to: Is it possible to automate text changes on individual page headers and footers? #78319
Peter KahrelParticipantSo a script would look for all instances of the character style, add a vertical bar in the margin at the whole range of the character style, and increment the revision number. The only problem with this is that when you apply a character style to a range of text, any character styles already applied to that range will be overridden.
Your specs are very specific, so a script like that is unlikely to exist, but it shouldn’t be particularly complicated.
September 24, 2015 at 2:02 am in reply to: Is it possible to automate text changes on individual page headers and footers? #78315
Peter KahrelParticipantFrank,
Text variables won’t work because you won’t be able to restrict their scope to a certain page. But it’s not too difficult to update the revision number of a page using a script. The script would look for a change, override the footer on the page if it’s not already overridden, and increment the revision number.
If only text insertions and deletions changes count as changes, then you could use InDesign’s ‘Track Changes’ feature to look for changes, increment the revision number on the page, and accept all changes to clear the document (or story, since Track Changes is story-based).
Changes in format and object position aren’t tracked by InDesign, so if these too should be recorded, then you need to mark the text or the page with e.g. a character style, as you suggested. A script can then look for occurrences of that character style and set the revision number (and remove the instances of the character style).
Peter KahrelParticipant\$ confuses WhatTheGrep probably because $ is a grep symbol. Other escaped grep symbols, too, probably confuse it. You could try \^ and and see what happens.
Until CC, the $ symbol was problematic in another way as well. InDesign had problems finding more than one instance (on Windows anyway). In CS6 and earlier, using \x24 or [$] is a workaround.
Peter KahrelParticipantChris,
No need to add word boundaries for every abbreviation:
\<(Jdsc|Jfar|Jnl|Jsf|Tdsc|Tfar|Tnl|Tsf|Tjdsc|Tjfar|Tjnl|Tjsf|Tc|Ti|Tu)\>
does the job and save some typing.
Peter
PS: Thanks for mentioning the guide!
Peter KahrelParticipantForgot to mention that the GREP replacement in the previous post doesn’t work if a number is the last text in a cell or a story. To make it work everywhere you’d have to add a single symbol at the end of numbers at cell- and story-end, then run the above query, and finally remove that added symbol. For that symbol I use a hair space to reduce the impact on the document.
So you’d have three queries:
(Place a hair space at the end of each cell and each story)
Find what: (\d)\Z
Change to: $1~%(Insert the thousands separators)
Find what: (\d)(?=(\d\d\d)+,?)
Change to: $1\x20(Remove the hair spaces at the end of cells and stories)
Find what: ~%\Z
Change to: <nothing>To make running sequences of GREP queries a bit easier, you can use this script:
https://www.kahrel.plus.com/indesign/grep_query_runner.htmlPeter
Peter KahrelParticipantInsertion of thousand separators goes back to Friedl’s ‘Regular Expressions’. The one here is a slight variation in order to deal with the decimal part. \x20 is the space character.
Find what: (\d)(?=(\d\d\d)+[,]?)
Change to: $1\x20Peter
Peter KahrelParticipantThe problem is that unlike many other programs, InDesign isn’t very good at finding locations such as ^ and $ on their own. You can’t replace $ with e.g. ) to insert a parenthesis at the end of the paragraph.
Seems to me that the only way you can get your grep to work is using (\r|\. )\K\u which assumes that a capital after a \r is the beginning of a sentence. You miss the first sentence in a story though.
Peter
-
AuthorPosts
