|
| 1 | +/* source一覧 |
| 2 | + |
| 3 | +引数 ルートフォルダ名 |
| 4 | + 空白の場合はカレントディレクトリを使用する。 |
| 5 | +*/ |
| 6 | + |
| 7 | +#g_dll_ohtorii_tools=val(getarg(30)); |
| 8 | +$label=getarg(0); |
| 9 | +$arg1=getarg(1); |
| 10 | +$arg2=getarg(2); |
| 11 | +$arg3=getarg(3); |
| 12 | +$arg4=getarg(4); |
| 13 | +$arg5=getarg(5); |
| 14 | + |
| 15 | +$g_root_macro_directory =dllfuncstrw(#g_dll_ohtorii_tools,"StaticStatusGetRootMacroDirectory"); |
| 16 | + |
| 17 | + |
| 18 | +call $label, $arg1, $arg2, $arg3, $arg4, $arg5; |
| 19 | +endmacro $$return; |
| 20 | + |
| 21 | +gather_candidates: |
| 22 | + $$root_dir=$$1; |
| 23 | + if($$root_dir==""){ |
| 24 | + //現在実行中のマクロ(このファイル)のディレクトリを調べる |
| 25 | + $$root_dir=currentmacrodirectory; |
| 26 | + } |
| 27 | + |
| 28 | + ##r = dllfuncw(#g_dll_ohtorii_tools, "BeginSource", "source"); |
| 29 | + if(!##r){ |
| 30 | + return "0"; |
| 31 | + } |
| 32 | + call AppendFolders $$root_dir; |
| 33 | + ##r = dllfuncw(#g_dll_ohtorii_tools, "EndSource"); |
| 34 | + if(!##r){ |
| 35 | + return "0"; |
| 36 | + } |
| 37 | + |
| 38 | + return "1"; |
| 39 | + |
| 40 | +AppendFolders: |
| 41 | + $$root_dir = $$1; |
| 42 | + ##objFSO = createobject("Scripting.FileSystemObject"); |
| 43 | + ##objFolder = callmethod_returnobj(##objFSO,"GetFolder",$$root_dir); |
| 44 | + ##objFiles = getpropobj(##objFolder,"Files"); |
| 45 | + while(1){ |
| 46 | + ##objFile = getcollection(##objFiles); |
| 47 | + if(##objFile==0){ |
| 48 | + break; |
| 49 | + } |
| 50 | + $$name=getpropstr(##objFile,"Name"); |
| 51 | + $$basename=member( ##objFSO, "GetBaseName", $$name ); |
| 52 | + $$ext=tolower(member( ##objFSO, "GetExtensionName", $$name )); |
| 53 | + releaseobject ##objFile; |
| 54 | + if($$ext!="mac"){ |
| 55 | + continue; |
| 56 | + } |
| 57 | + ##r=dllfuncw(#g_dll_ohtorii_tools, "AppendCandidate", $$basename, ""); |
| 58 | + } |
| 59 | + releaseobject ##objFiles; |
| 60 | + releaseobject ##objFolder; |
| 61 | + releaseobject ##objFSO; |
| 62 | + |
| 63 | + return ; |
0 commit comments