/* =========================================================================
InDesign ExtendScript
NAME: InStylesList.jsx
VERSION: 0.00000000000000000000000001 Alfa :)
AUTHOR: Vitaly Batushev
DATE : 15.01.2006
DESCRIPTION:
SUPPORT: http://indesign.rudtp.ru
E-MAIL: vbatushev@indesign.rudtp.ru
====================================================================== */
with (app) {
if (documents.length == 0) { alert('No open documents!'); }
var myDoc = activeDocument;
var stylesList = 'PUBLICATION: ' + myDoc.name + '\n';
stylesList += '\n' + 'LIST OF CHARACTER STYLES ' + '\n';
for (i = 0; i < myDoc.characterStyles.length; i++) {
stylesList += 'STYLE NAME: ' + myDoc.paragraphStyles[i].name + '\n';
var myStyle = myDoc.characterStyles[i].properties.toSource();
stylesList += myStyle + '\n';
}
stylesList += '\n' + 'LIST OF PARAGRAPH STYLES ' + '\n';
for (i = 0; i < myDoc.paragraphStyles.length; i++) {
stylesList += 'STYLE NAME: ' + myDoc.paragraphStyles[i].name + '\n';
var myStyle = myDoc.paragraphStyles[i].properties.toSource();
stylesList += myStyle + '\n';
}
var myPlaceFile = new File;
var myPlaceFile = myPlaceFile.saveDlg('Save File', 'TextFiles: *.txt');
myPlaceFile.open('w');
myPlaceFile.write(stylesList);
myPlaceFile.close();
myPlaceFile.execute();
}