Forum Replies Created
-
AuthorPosts
-
Theunis De Jong
MemberCan't really think of other ways I'd go about it?
A custom Preflight (CS4) comes to mind. One-click access to all suspect items.
Theunis De Jong
MemberChoke my throat and call me a smurf. I tested the script, and I am so positive it worked yesterday! But something goes wrong right at the very start — I stated that 'it should create the style automatically if it doesn't exist yet', and, for sure, that's the part where it fails!
Here is a new, improved version. Better, stronger, faster … well, it works. (I double-checked this time
)If you have a dedicated “Underline” character style as well, it makes removing this a bit easier. Just delete the style “NoUnderline” and replace with “Underline”. Then re-run the script, and it will re-create the style. (Honestly.)
//DESCRIPTION: Begone, Ugly End Of Line Underlining!
// (c) Jongware 16-Dec-2009
var blankStyle = app.activeDocument.characterStyles.item(“NoUnderline”);
try { blankStyle.index; } catch(_)
{
blankStyle = undefined;
}
if (blankStyle == undefined)
{
blankStyle = app.activeDocument.characterStyles.add();
blankStyle.name = “NoUnderline”;
blankStyle.underline = false;
}
for (a=0; a<app.selection[0].lines.length; a++)
{
if (app.selection[0].lines[a].characters.item(-1).contents == ” “)
app.selection[0].lines[a].characters.item(-1).appliedCharacterStyle = blankStyle;
}
Theunis De Jong
MemberThat's odd. The script is written & tested for CS4, but it ought to work for CS3 as well. (You are not using an even older version, are you?)
Can you check if it actually creates a character style called “NoUnderline”? If there isn't one, it should make it automatically. (FYI, the variable 'blankStyle' should point to this character style, and should apply it in lline 31.)
It seems you didn't do anything wrong copying or running the script, as it would never have made it all the way to that line.
Theunis De Jong
MemberChoke my throat and call me a smurf. I tested the script, and I am so positive it worked yesterday! But something goes wrong right at the very start — I stated that 'it should create the style automatically if it doesn't exist yet', and, for sure, that's the part where it fails!
Here is a new, improved version. Better, stronger, faster … well, it works. (I double-checked this time
)If you have a dedicated “Underline” character style as well, it makes removing this a bit easier. Just delete the style “NoUnderline” and replace with “Underline”. Then re-run the script, and it will re-create the style. (Honestly.)
//DESCRIPTION: Begone, Ugly End Of Line Underlining!
// (c) Jongware 16-Dec-2009
var blankStyle = app.activeDocument.characterStyles.item(“NoUnderline”);
try { blankStyle.index; } catch(_)
{
blankStyle = undefined;
}
if (blankStyle == undefined)
{
blankStyle = app.activeDocument.characterStyles.add();
blankStyle.name = “NoUnderline”;
blankStyle.underline = false;
}
for (a=0; a<app.selection[0].lines.length; a++)
{
if (app.selection[0].lines[a].characters.item(-1).contents == ” “)
app.selection[0].lines[a].characters.item(-1).appliedCharacterStyle = blankStyle;
}
Theunis De Jong
MemberThat's odd. The script is written & tested for CS4, but it ought to work for CS3 as well. (You are not using an even older version, are you?)
Can you check if it actually creates a character style called “NoUnderline”? If there isn't one, it should make it automatically. (FYI, the variable 'blankStyle' should point to this character style, and should apply it in lline 31.)
It seems you didn't do anything wrong copying or running the script, as it would never have made it all the way to that line.
Theunis De Jong
MemberYes, that's annoying. ID cannot find/change something based on soft line endings, so a Javascript would come in handy. (Audience: “Javascript?”) Sure, no problem. Copy and paste the following one into a plain text editor (Notepad, TextEdit in plain text mode; best is Adobe's own ESTK editor that comes installed with InDesign) and save into your User Scripts folder as “NoUnderline.jsx”. Select an appropriate amount of text, and run the script. It will add a character style to underlined spaces at the end of each line, and leave other end characters (such as soft hyphens) alone. If your text changes and you want the underlines back, do the following:
1. Edit the character style “NoUnderline”; set Underlining on.
2. Delete the character style; select “Preserve Formatting”.
3. Run the script again on your selection of text.
Alternatively, select a run of text and remove the character style by replacing it with “[None]” and restore Underline in the Change Formatting box.
Here's the script:
//DESCRIPTION: Begone, Ugly End Of Line Underlining!
// (c) Jongware 16-Dec-2009
try {
blankStyle = app.activeDocument.characterStyles.item("NoUnderline");
} catch (_)
{
blankStyle = app.activeDocument.characterStyles.add();
blankStyle.name = "NoUnderline";
blankStyle.underline = false;
}
for (a=0; a<app.selection[0].lines.length; a++)
{
if (app.selection[0].lines[a].characters.item(-1).contents == " ")
app.selection[0].lines[a].characters.item(-1).appliedCharacterStyle = blankStyle;
}
Theunis De Jong
MemberYes, that's annoying. ID cannot find/change something based on soft line endings, so a Javascript would come in handy. (Audience: “Javascript?”) Sure, no problem. Copy and paste the following one into a plain text editor (Notepad, TextEdit in plain text mode; best is Adobe's own ESTK editor that comes installed with InDesign) and save into your User Scripts folder as “NoUnderline.jsx”. Select an appropriate amount of text, and run the script. It will add a character style to underlined spaces at the end of each line, and leave other end characters (such as soft hyphens) alone. If your text changes and you want the underlines back, do the following:
1. Edit the character style “NoUnderline”; set Underlining on.
2. Delete the character style; select “Preserve Formatting”.
3. Run the script again on your selection of text.
Alternatively, select a run of text and remove the character style by replacing it with “[None]” and restore Underline in the Change Formatting box.
Here's the script:
//DESCRIPTION: Begone, Ugly End Of Line Underlining!
// (c) Jongware 16-Dec-2009
try {
blankStyle = app.activeDocument.characterStyles.item("NoUnderline");
} catch (_)
{
blankStyle = app.activeDocument.characterStyles.add();
blankStyle.name = "NoUnderline";
blankStyle.underline = false;
}
for (a=0; a<app.selection[0].lines.length; a++)
{
if (app.selection[0].lines[a].characters.item(-1).contents == " ")
app.selection[0].lines[a].characters.item(-1).appliedCharacterStyle = blankStyle;
}
Theunis De Jong
MemberCtrl+Alt+F for Find Fonts, Ctrl+Alt+G for Glyphs, Ctrl+Alt+J for Merge Cells (“Join”).
F3 plus a few modifiers for instant Uppercase, Lowercase, and Title Case — never can remember where I put where, but it's all somewhere under F3.
Alt+N for a Number space — to assign, it needs a bit of trickery under Windows (enter “Ctrl+Alt+N”, then select “Ctrl+” with the mouse and select Delete from the mouse menu
).Theunis De Jong
MemberCtrl+Alt+F for Find Fonts, Ctrl+Alt+G for Glyphs, Ctrl+Alt+J for Merge Cells (“Join”).
F3 plus a few modifiers for instant Uppercase, Lowercase, and Title Case — never can remember where I put where, but it's all somewhere under F3.
Alt+N for a Number space — to assign, it needs a bit of trickery under Windows (enter “Ctrl+Alt+N”, then select “Ctrl+” with the mouse and select Delete from the mouse menu
).Theunis De Jong
MemberThese page sizes are entirely different. You can experiment with margin settings that ought to work for both documents (although in both cases you will have a lot of white space at either top/bottom or left/right) by creating a document that has got the width of US Letter and the height of A4: 8.5 inch wide, 29.7 mm high. Draw rectangles on your master page(s) with each of these formats (put them on a non-printing layer) and try to stay within a reasonable distance of all four sides.
Although you can change the 'actual' page size after you worked on your document, it may not even be necessary. You can't (easily?) change the page size while exporting to PDF, but I think it's possible to target a paper size when printing.
The only other option is to design for one size and then put yourself at the mercy of Layout Adjustment when changing to the other size.
Theunis De Jong
MemberThese page sizes are entirely different. You can experiment with margin settings that ought to work for both documents (although in both cases you will have a lot of white space at either top/bottom or left/right) by creating a document that has got the width of US Letter and the height of A4: 8.5 inch wide, 29.7 mm high. Draw rectangles on your master page(s) with each of these formats (put them on a non-printing layer) and try to stay within a reasonable distance of all four sides.
Although you can change the 'actual' page size after you worked on your document, it may not even be necessary. You can't (easily?) change the page size while exporting to PDF, but I think it's possible to target a paper size when printing.
The only other option is to design for one size and then put yourself at the mercy of Layout Adjustment when changing to the other size.
Theunis De Jong
MemberWelcome! (Ho? geldiniz!)
InDesign does not support 'random' numbering, only consecutive numbers. So use this Javascript, it will insert numbers every 10 paragraphs. Click your text cursor in the running story where you want them, and double-click the script.
for (a=10; a<app.selection[0].parentStory.paragraphs.length; a+=10)
{
app.selection[0].parentStory.paragraphs[a-1].insertionPoints[0].contents = String(a)+”. “;
}Theunis De Jong
MemberWelcome! (Ho? geldiniz!)
InDesign does not support 'random' numbering, only consecutive numbers. So use this Javascript, it will insert numbers every 10 paragraphs. Click your text cursor in the running story where you want them, and double-click the script.
for (a=10; a<app.selection[0].parentStory.paragraphs.length; a+=10)
{
app.selection[0].parentStory.paragraphs[a-1].insertionPoints[0].contents = String(a)+”. “;
}Theunis De Jong
MemberI considered using your GREP (so it would have been a full joint effort). But I think it would have been slightly less typework to search for
b(5[4-9]|[6-9][0-9]|10[0-4])b
GREP can't do proper number ranges but I can

As a side note: I prefer using the Break code b over not-groups. The Break code also works as marker at the start or end of a story or paragraph. Besides, the '+' in (?!d+) is not necessary, and you forgot the equivalent (?<!d) at the start of that long string.
Is it me, or should all good GREP strings look like the ”$%#$!” one used to see in comics before they went “adult”?
Theunis De Jong
MemberHey, Hank, I did not notice that 'in a certain character style'! ('dans une certaine condition', perhaps)
Add this line somewhere after the findWhat line:
app.findGrepPreferences.appliedCharacterStyle = “YourCharacterStyleNameHere“;
to search for just those numbers. The rest of the script is, unlikely as it may sound, totally unaffected by this change — it merely now finds, and optionally changes, numbers that have the style applied.
-
AuthorPosts
