Using Glyph Search; Tables - Adobe 65009333 - InCopy CS4 - PC Manual

Scripting guide: javascript
Hide thumbs Also See for 65009333 - InCopy CS4 - PC:
Table of Contents

Advertisement

Text and Type
function myRemoveDuplicates(myArray){
//Semi-clever method of removing duplicate array items; much faster
//than comparing every item to every other item!
var myNewArray = new Array;
myArray = myArray.sort();
myNewArray.push(myArray[0]);
if(myArray.length > 1){
for(var myCounter = 1; myCounter < myArray.length; myCounter ++){
}
}
return myNewArray;
}

Using glyph search

You can find and change individual characters in a specific font using the
methods and the associated
following scripts fragment shows how to find and change a glyph in a sample document (for the complete
script, see FindChangeGlyphs):
//Clear glyph search preferences.
app.findGlyphPreferences = NothingEnum.nothing;
app.changeGlyphPreferences = NothingEnum.nothing;
var myDocument = app.documents.item(0);
//You must provide a font that is used in the document for the
//appliedFont property of the findGlyphPreferences object.
app.findGlyphPreferences.appliedFont = app.fonts.item("Times New Roman Regular");
//Provide the glyph ID, not the glyph Unicode value.
app.findGlyphPreferences.glyphID = 374;
//The appliedFont of the changeGlyphPreferences object can be
//any font available to the application.
app.changeGlyphPreferences.appliedFont = app.fonts.item("ITC Zapf Dingbats Medium");
app.changeGlyphPreferences.glyphID = 85;
myDocument.changeGlyph();
//Clear glyph search preferences.
app.findGlyphPreferences = NothingEnum.nothing;
app.changeGlyphPreferences = NothingEnum.nothing;

Tables

Tables can be created from existing text using the
be created at any insertion point in a story. The following script fragment shows three different ways to
create a table (for the complete script, see MakeTable):
if(myArray[myCounter] != myNewArray[myNewArray.length -1]){
myNewArray.push(myArray[myCounter]);
}
findGlyphPreferences
and
changeGlyphPreferences
convertTextToTable
and
findGlyph
changeGlyph
objects. The
method, or an empty table can
Tables 50

Advertisement

Table of Contents
loading

This manual is also suitable for:

Incopy cs4

Table of Contents