Forum Replies Created
-
AuthorPosts
-
Kai Rübsamen
MemberDid you copy everything from the forum. It works here correct with your example. In line 9 it should be p=0 instead of p=)
Otherwise your document is needed.Kai Rübsamen
MemberYour second example is well prepaired, thank you. Then: All Caps is set to ‘City’, but not to ‘Listing’.
So I decide to compare the acutal applied paragraph style with the style of the previous paragraph.
Try this one:
(function () { var curDoc = app.documents[0], allParas = curDoc.stories.everyItem().paragraphs.everyItem().getElements(), p, curPara, prevPara, pStyleName; for (p = 0; p < allParas.length; p++) { curPara = allParas[p]; prevPara = allParas[p-1]; pStyleName = curPara.appliedParagraphStyle.name; if (pStyleName == "COMPANY NAME" && (prevPara.appliedParagraphStyle.name == "LISTING TYPE" || prevPara.appliedParagraphStyle.name == "Listing type no space")) { allParas[p].appliedParagraphStyle = "COMPANY NAME - No space above"; } else if (pStyleName == "LISTING TYPE" && allParas[p-1].appliedParagraphStyle.name == "CITY") { allParas[p].appliedParagraphStyle = "Listing type no space"; } } }());Kai
Kai Rübsamen
MemberHaha, your example doesn’t really help ;-)
First of all, you should have started a new thread for this, but anyway:
1. The first paragraph have Basic Paragraph applied, not city …
2. Why not simply change the styles and remove the space above?
3. Are you sure, that everything is in All Caps? So, check the icons between city and listing type!I assume, that you have places, where space above is needed. But where is your example? What should be changed, and what should not be changed?
Kai
Kai Rübsamen
MemberIt’s not clear to me, where and how there is space. So please provide a idml file before/after, with some entries, that we can inspect your data.
Kai
Kai Rübsamen
MemberHi Tommy,
in this case, you need a so called lookahead, that find the position of your second phrase, but does not include the characters as a found.
info(?=name) OR (?=infoname)info
Kai
September 15, 2016 at 6:55 am in reply to: Make everything bold before (and included) a colon using GREP? #88368Kai Rübsamen
MemberEverything from start included the colon:
^[^:]+:
Everything from start excluded the colon:
^[^:]+
The GREP find the beginning of a paragraph, followed by anything, that is not a colon, one or multiple times, followed by a colon (first case) or not (second case)
Kai
Kai Rübsamen
MemberSo, problem solved with your solution?
The grep for small caps could be a bit shorter:
^.\K(([\w.,']+)\x20){3}[\w.,']+If not: The trick is, to deactivate ‘ordinals’ in the smallCaps cStyle and let small caps begin on the second character.
Kai Rübsamen
MemberHi Kathy,
this should work for all open docs:
app.documents.everyItem().layers.itemByName("test").remove();August 27, 2016 at 2:40 am in reply to: Applescript question: Deleting empty column from table #87865Kai Rübsamen
MemberAaron, this isn’t true, but we speak Javascript instead of Applescript! ;-)
Kai
Kai Rübsamen
MemberHi Brendan,
try this one:
var allTables = app.activeDocument.stories.everyItem().tables.everyItem(); allTables.rows.everyItem().height = 5.5; allTables.columns.everyItem().width = 15; allTables.rows.firstItem().height = 12;
It will not check, if the first line is a real header-row. It will give the height to all first lines.
Realize also, that you get maybe overset or the textframe is not fitting the table.Kai
Kai Rübsamen
MemberNo. ‘\x20’ is the shortcut for \x{0x20}. This is another way to notate the unicode-value of a normal space. You can see this, if you select a space and read the value in the information panel.
While includes all kind of whitespace, the tab, a shift return and a return, \x20 will find only simple spaces :)
Kai Rübsamen
MemberThe first ones should be
~8\x20(.)
To your explanation on #2: It looks not to the first character of the next paragraph, since lookararounds find only positions and not characters.
Kai Rübsamen
MemberHi Aaron,
this can be done in two steps!
1. Remove manual bullets
Find what: •\x20(.)
Change to: $1 + applied bullet style… will find a bullet, followed by a space, followed by any character (the any character is needed, because you can either apply formatting or change something >> with this trick you can do both in one go!)
2. Find the last bullet para
Find what: \r(?!.) + applied bullet style
Change to: nothing + + applied bullet last style… will find a return with applied style bulletStyle, if it is not followed by a character with the same formatting. So it will find the last return in a range.
best
KaiKai Rübsamen
MemberFrom a technical point of view, there is no ‘simply update a file’. InDesign will place this file, as if it were never in your document.
So the idea is:
1. Create a template with styles in InDesign
2. Export a file to rtf
3. The texter write in this file and use your styles
4. Update your fileIf the texter use your styles and you did nothing in your document, you should get the right result.
If you want a bit more comfort, you should try wordsflow from emsoft.
Also I can recommend Anne Maries Title on InDesign/Word-Workflow at Lynda.com.
Kai
Kai Rübsamen
MemberNo, it’s like learning how to play guitar. If you understand some concepts, you will be able to play your own songs.
\x20 is the unicode value for a space-character. It’s a way to make spaces visible in your code. You can check that, if you select a space and read the value in the Information-panel. This will show you ‘0x20’. So you could write \x{0x20} or in this case the shortcut \x20
-
AuthorPosts
