OK, try adding this to your scripts folder… Done slighty long hand so's you can swap about if needed… To run select Custom Rename at the bottom of the Tools menu… #target bridge #engine main if ( BridgeTalk.appName == 'bridge' ) { var toolMenu = MenuElement.find( 'Tools' ), customRename = new MenuElement( 'command', 'Custom Rename', '-at the end of toolMenu', 'muppet009' ); }; customRename.onSelect = function () { renameFiles(); } function renameFiles() { if ( app.documents.length == 0 ) { return; } var i, count, doc, file, parts, baseName, ext, oldName, newName; doc = app.document; count = doc.visibleThumbnailsLength; for ( i = 0; i < count; i++ ) { if ( doc.visibleThumbnails.type == 'file' ) { oldName = decodeURI( doc.visibleThumbnails.name ); baseName = oldName.match( /(.*)\.[^\.]+$/ )[1]; ext = oldName.replace( /^.*\./,'' ); parts = baseName.split( '-', 4 ); newName = parts[0] + '-' + parts[1] + '-' + parts[3] + '-' + parts[2]; if ( ext != '' ) { newName += '.' + ext; } file = doc.visibleThumbnails.spec; //$.writeln( newName ); file.rename( newName ); }; }; };
... View more