Peter,
Antwort auf: Remember that in WordPerfect it is easy to search for some x in italic followed by some y not in italic? It's not straightforward in inDesign.
Ah, I remember very well!
It is about twenty years ago, isn't it?
Antwort auf:
what I found easiest in the end was to convert italics to HTML-like codes and
An interesting approach.
You loved WordPerfect too, as one can see.
Did you ever work with Ventura Publisher?
In this point Ventura seems to bee related with WordPerfect.
Or do you know CCS Textline?
How fine it would be to make the borders of formating styles visible e.g. in text mode.
This would help to find overrides and the extension of overrides, too.
Here is my script-approach (in CS2) to do the job (there might be some code of yours inside the script):
// ExtendCharstyle2Symbols.jsx
Array.prototype.array_merge = function() {
for(x=0;x for(y=0;y this[this.length] = arguments[x][y];
}
}
};
var myCounter = 0;
var myDoc = app.documents[0];
if (app.selection.length > 0) {
var myRange = app.selection[0];
}
else {
var myRange = myDoc;
}
var myBaseStyle = "Italic";
var myDefaultSymbols = ",;:";
var mySymbols = new Array
var theDialog = myDisplayDialog();
var myStyle = myDoc.characterStyles.item(theDialog[0]);
var myNewStyle = checkCS(myStyle.name + "_extended", myStyle);
var mySymbols = theDialog[1].split("");
app.findPreferences = null; app.changePreferences = null;
var myResult = myRange.search("", false, false, undefined,{appliedCharacterStyle:myStyle});
for (oneResult = 0; oneResult < myResult.length; oneResult++)
{
try{
var myIndex = myResult[oneResult].characters[-1].index;
extendCharStyle(myResult[oneResult].parentStory.characters[myIndex +1]);
} catch(e){}
}
alert("Ergebnis:\r" + myCounter + " Ersetzungen");
// --------------------------------------------------------------------
// Prüfung des Zeichens danach und ggf. Erweiterung des Zeichenformats
// --------------------------------------------------------------------
function extendCharStyle(theCharAfter)
{
for (oneSymb = 0; oneSymb < mySymbols.length; oneSymb++)
{
try
{
if (theCharAfter.contents == mySymbols[oneSymb])
{
//theCharAfter.appliedCharacterStyle = myStyle;
theCharAfter.appliedCharacterStyle = myNewStyle;
myCounter += 1;
}
}
catch(e){}
}
}
// --------------------------------------------------------------------
// Dialog zur Auswahl von Zeichenformat und Folgezeichen
// --------------------------------------------------------------------
function myDisplayDialog(){
var myFieldWidth = 80;
var myCharStyles = myDoc.characterStyles.everyItem().name;
// Festlegung Vorauswahl
for (theCSIndex = myCharStyles.length-1; theCSIndex >= 0; theCSIndex--)
{
if (myCharStyles[theCSIndex].substr(0,myBaseStyle.length) == myBaseStyle) break;
}
var myDialog = app.dialogs.add({name:"Erweitere Zeichenformat"});
with(myDialog.dialogColumns.add()){
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Zeichenformat:", minWidth:myFieldWidth});
}
with(dialogColumns.add()){
var mySourceDropdown = dropdowns.add({stringList:myCharStyles, selectedIndex:theCSIndex});
}
}
with(dialogRows.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Folgezeichen:", minWidth:myFieldWidth});
}
with(dialogColumns.add()){
var mySymbolsField = textEditboxes.add({editContents:myDefaultSymbols});
}
}
}
var myResult = myDialog.show();
if(myResult == true){
var theCharStyle =myCharStyles[mySourceDropdown.selectedIndex];
var theSymbolList = mySymbolsField.editContents;
myDialog.destroy();
}
else{
myDialog.destroy()
exit();
}
return [theCharStyle, theSymbolList] ;
}
// -------------------------------------------------------------------------------------
// Überprüfe Zeichenformat
// -------------------------------------------------------------------------------------
function checkCS(oneStyle, myBase){
try {
app.activeDocument.characterStyles.item(oneStyle).name;
}
catch (e) {
app.activeDocument.characterStyles.add({name:oneStyle, basedOn:myBase});
}
return app.activeDocument.characterStyles.item(oneStyle)
}