Ich glaube nicht, daß an denn Exportnamen allgemein festlegen kann (klappt das bei der Druckdatei?).
Aber Du kannst schon exportieren mit Angabe vom Dateinamen (+ Suffix):
Code myStory = app.selection[0].parentStory; myFileName = app.documents[0].name.split(".indd")[0] + ".rtf"; myFile = File("~/Desktop/" + myFileName) myStory.exportFile(ExportFormat.rtf, myFile); Richtig Sinn macht dies aber nicht bei Textflüssen, sondern erst beim Export des ganzen Dokuments als PDF oder Interchange-Format. Ergo: Mein Beispiel ist schlecht und ich zu faul, ein neues zu stricken.
Ein interessantes Skript zum Export gibt es von Peter Kahrel im Adobe Scripting Forum:
http://www.adobeforums.com/[email protected] @.3bbf225d/4 Weil die Skripte dort irgendwann verschwinden, sichere ich es hier:
Code // BatchConverter.jsx // an InDesign CS2 Script from Peter Kahrel // http://www.adobeforums.com/cgi-bin/[email protected] @.3bbf225d/4 if( app.documents.length > 0 ) showFilebox = false else showFilebox = true startDir = 'Type folder or * to pick folder from list' //get all (five) necessary parameters into an array params = getData( startDir, showFilebox ) app.dialogs.everyItem().destroy() //name each parameter for legibility dir = params[0] subdirInclude = params[1] sourceType = params[2] destinationType = params[3] pdfPreset = params[4] if( destinationType == sourceType ) errorM( ' Source and destination types\rmust be different' ) if( app.documents.length > 0 ) alldocs = app.documents.everyItem().fullName else if( subdirInclude == true ) alldocs = getAllfiles( dir, [], sourceType ) else alldocs = Folder( dir ).getFiles( '*' + sourceType ) for( myCounter = 0; myCounter < alldocs.length; myCounter++ ) { app.open( alldocs[myCounter] ) f = new File( alldocs[myCounter].fullName.replace( RegExp(sourceType+'$'), destinationType )) switch( destinationType ) { case '.pdf' : app.documents.item( alldocs[myCounter].name ).exportFile( ExportFormat.pdfType, f , false , pdfPreset ); break; case '.inx' : app.documents.item( alldocs[myCounter].name ).exportFile( ExportFormat.indesignInterchange, f ); break; case '.rtf' : longestStory( app.documents.item( alldocs[myCounter].name )).exportFile( ExportFormat.rtf, f ); break; case '.indd' : app.activeDocument.save( f ) } if( showFilebox == true ) app.activeDocument.close() } alldocs = [] //end--------------------------------------------------------------------- function getData( dir, showFilebox ) { var pdfPresets = app.pdfExportPresets.everyItem().name var subfolders, sourceButtons, destButtons, dropdown var dlg = app.dialogs.add( { name : 'File converter' } ) with(dlg) { with( dialogColumns.add() ) { if( showFilebox == true ) { with(borderPanels.add( ) ) { with( dialogColumns.add() ) staticTexts.add( { staticLabel : 'Folder:' } ) with( dialogColumns.add() ) dir = textEditboxes.add( { editContents : dir, minWidth : 235 } ) } with(borderPanels.add()) with( dialogColumns.add() ) subfolders = checkboxControls.add( { staticLabel : 'Include subfolders' , checkedState : true } ) } else { dir.editContents = '' subfolders = false subfolders.checkedState = false } with( borderPanels.add() ) { staticTexts.add( { staticLabel : 'Source file format: ', minWidth : 126 } ) with( sourceButtons = radiobuttonGroups.add( ) ) { radiobuttonControls.add( { staticLabel : 'InDesign', checkedState : true } ) if( showFilebox == true ) radiobuttonControls.add( { staticLabel : 'Interchange (INX) ' } ) } } with( borderPanels.add() ) { staticTexts.add( {staticLabel : 'Destination file format: ' } ) with( destButtons = radiobuttonGroups.add( ) ) { if( showFilebox == true ) radiobuttonControls.add( { staticLabel : 'InDesign' } ); radiobuttonControls.add( { staticLabel : 'PDF' , checkedState : true } ) radiobuttonControls.add( { staticLabel : 'Interchange (INX)' } ) radiobuttonControls.add( { staticLabel : 'Rich Text Format (RTF)' } ) } } with( borderPanels.add() ) { staticTexts.add( { staticLabel : 'PDF presets:', minWidth : 93 } ) dropDown = dropdowns.add( { stringList : pdfPresets, selectedIndex : 0 }) } } } if( dlg.show() == false ) destroyExit() //if * pressed get folder from folder dialog //and display script dialog again if( dir.editContents == '*' ) { dir = Folder.selectDialog( 'Select a folder', dir ) if( dir == null ) destroyExit() return getData( dir, showFilebox ) } //place the values to be returned in an array return[ dir.editContents, subfolders.checkedState, showFilebox == true ? [ '.indd', '.inx' ][sourceButtons.selectedButton] : [ '.indd' ][sourceButtons.selectedButton] , showFilebox == true ? [ '.indd', '.pdf', '.inx', '.rtf' ][destButtons.selectedButton] : [ '.pdf', '.inx', '.rtf' ][destButtons.selectedButton] , pdfPresets[dropDown.selectedIndex] ] } function getAllfiles( dir, array, mask ) { var f = Folder( dir ).getFiles( '*.*' ) for( var myCounter = 0; myCounter < f.length; myCounter++ ) if( f[myCounter] instanceof Folder ) getAllfiles( f[myCounter], array, mask ) else if( f[myCounter].name.substr( -mask.length ) == mask ) array.push( f[myCounter] ) return array } //get longest story in document, //assuming it is the central one function longestStory( doc ) { var temp var longest = 0 for( var myCounter = 0; myCounter < doc.stories.length; myCounter++ ) if( doc.stories[myCounter].contents.length > longest ) { longest = doc.stories[myCounter].contents.length temp = myCounter } return doc.stories[temp] } function destroyExit() { app.dialogs.everyItem().destroy() exit() } function errorM( m ) { alert( m ) exit() } Weitere Skripte von Peter:
http://www.kahrel.plus.com/indesignscripts.html Viele Grüße
Martin