最近拡張機能を書き出したので記念カキコ
最近拡張機能を書き出したので記念カキコ
<HTML> <HEAD> <TITLE>指定したタグ内にTAS突っ込んで子要素全部にLOC</TITLE> <SCRIPT LANGUAGE="javascript"> <!-- //ファイル取得 function SiteFileFind( extra ) { var extList = dw.getTokens( extra, "," ); var path = dw.getSiteRoot(); var i; fileList = new Array() for( i = 0; i < extList.length; i++ ) { FileFind( path, extList[ i ] ); } return fileList; } function FileFind( path, extList ) { var i; var dirs = DWfile.listFolder( path, "directories" ); for( i = 0; i < dirs.length; i++ ) FileFind( path + dirs[ i ] + "/", extList ); var files = DWfile.listFolder( path + "*." + extList, "files" ); for( j = 0; j < files.length; j++ ) fileList.push( path + files[ j ] ); } function runCommand(){ var file = SiteFileFind('html,htm'); for(var i = 0; i < file.length; i++){ var crfile = dw.openDocument(file[i]); var doc = dw.getDocumentDOM(); doc.detachFromTemplate(); } dreamweaver.saveAll(); for(var i = 0; i < file.length; i++){ var doc = dw.getDocumentDOM(file[i]); dw.closeDocument(doc) } } // --> </SCRIPT> </HEAD> <BODY onLoad="runCommand()" > </BODY> </HTML>