|
ぱとさん,こんにちは。
>マクロでやるとしても、鶴亀の側で、フォルダ構造情報を保持していない以上、
>こうやって、検索かけていくしかないわけで、やはり一定の時間はかかるわけ
>ですね。
考えてみれば毎回フォルダ情報を検索する必要もないわけで,いったん取得し
た情報を保存して使えば時間の節約になりそうです。新たにフォルダを作るとき
に情報の取得をやり直せばいいので,通常はかなり時間的に早くなります。
>動作イメージ的には、例えば、フォルダ検索操作をすると、インクリメンタル
>サーチで、該当するフォルダが次々とヒットして絞り込まれていくみたいな感
>じになればいいなあと虫のいいことを考えてました。
こちらはマクロではまず無理でしょう。本体で実装していたく意外にないよう
な気がしますが,果たしてどれだけの需要があるんでしょうね。
//--------- TKSearchFolder.mac ----------------------------------------//
////// オプション //////////////////////
#ime = 1; //かな漢字変換 1:ON, 0:OFF
////////////////////////////////////////
Begin:
menu "&S フォルダを検索して選択",
"&N フォルダ情報を新しく作成";
#r = result;
if( #r == 0 ) endmacro;
$FolderInfoFile = currentmacrodirectory + "\\TKFolderInfo.txt";
loaddll "tkinfo.dll";
$home = dllfuncstr("HomeDir");
openreg "CURRENTUSER", "Software\\Hidemaruo\\TuruKame\\Config";
#tmplnew = getregnum ("TmplNewMail");
if( #tmplnew ) writeregnum "TmplNewMail", 0;
#n = dllfunc("EnvChanged");
#n = dllfunc( "NewMail" );
#grephandle = hidemaruhandle(0);
#n = dllfunc("SwitchHeaderView", 0);
disabledraw;
gofiletop;
beginsel;
gofileend;
delete;
if( #r == 1 ) call SearchFolder;
else if( #r == 2 ) call MakeNewGFolderInfo;
if( #r == 2 ) goto Begin;
endmacro;
SearchFolder:
if( !existfile( $FolderInfoFile ) ) {
message "まずフォルダ情報を作成してください。";
closereg;
quit;
}
#imestate = imestate;
if( #ime != imestate ) imeswitch;
$search = input("フォルダ名は?(名前の一部でも可)");
if( imestate != #imestate ) imeswitch;
if( $search == "" ) quit;
insertfile $FolderInfoFile;
disabledraw;
gofiletop;
while( 1 ) {
searchdown $search;
if( !result ) break;
else {
#by = y;
golineend2;
$folder[#i] = gettext( 0, #by, x, y );
#i = #i + 1;
}
}
if( #i == 0 ) {
message "ありません。";
endmacro;
}
#n = dllfunc( "SetMainWndTop" );
closehidemaruforced #grephandle;
menuarray $folder, #i;
##r = result;
if( ##r <= 0 ) endmacro;
$name = $folder[ ##r - 1 ];
#accountlen = strstr($name,"\\");
$account = leftstr( $name, #accountlen );
$folder = midstr( $name, #accountlen + 1, 256 );
if( #accountlen < 0) {
$account = $name;
$folder = "";
}
#n = dllfunc( "SelectFolder", $account, $folder );
return;
MakeNewGFolderInfo:
grep ".", "subdir.bin", $home, subdir, regular;
replaceallfast "subdir\\.bin\\([0-9]+\\): ", "", regular;
replaceallfast "^[^\\\\]+\\n", "", regular;//アカウント名のみは削除
saveas $FolderInfoFile;
if( #tmplnew ) {
writeregnum "TmplNewMail", 1;
#n = dllfunc("EnvChanged");
}
closereg;
#n = dllfunc( "SetMainWndTop" );
closehidemaruforced #grephandle;
#n = dllfunc("SetAutoPushTimer", 2, "ok");
message "フォルダ情報ファイルを作成しました。";
return;
//---------------------------------------------------------------//
では, (^^)/~
山紫水明(ユーザー)
SANSHISUIMEI
|
|