|
秀まるおさん今日は、Iranoan です。
まだ確りと調べていませんが、Delete() 関数を使うと、DisableDraw() を
使うと本文が書き換えられるような気がするのですが、この予想があっている
としてもこれは仕様でしょうか? 末尾のマクロが、今調べているマクロです。
こちらの環境は、WindowsXP+IE6.0+秀丸メール Ver. 5.00beta32 です。
------------------------------------------------------------
Delete "tkinfo.dll";
if( !dllfunc( "IsHidemaruMailMain" ) )goto End;
call ChangeConf;
if( !dllfunc( "SelectFolder", "", "ゴミ箱" ) )call Error "ゴミ箱に移動";
while( 1 ){
if( !dllfunc( "SetFindPack","(\"spam\", target=\"X-TuruKame-Filter:
\", casesense, word ), flag=unread, inmail=0" ) )call Error "検索を
設定";
if( !dllfunc( "FindDown" ) )break;
call CheckDuplication;
if( ##return ){
#tmp = dllfunc( "Delete", 2 );
#tmp = dllfunc( "PrevMail" );
}
}
Ending:
#tmp = dllfunc( "SetFindPack", $s );
#tmp = dllfunc( "SwitchHeaderView", #head );
#tmp = dllfunc( "SetThreadView", #view );
#tmp = dllfunc( "SelectFolder", "", $folder );
setsearch $s2, #s2;
setreplace $r2;
openreg "CURRENTUSER","Software\\Hidemaruo\\TuruKame\\Config";
writeregnum "UnreadSwitch", #UnreadSwitch;
writeregnum "ActivateUnreadSwitch", #ActivateUnreadSwitch;
writeregnum "AllViewUnreadSwitch", #AllViewUnreadSwitch;
#tmp = dllfunc( "EnvChanged" );
closereg;
#tmp = dllfunc( "EnableDraw" );
End:
freedll;
endmacro;
Error:
message $$1 + "できませんでした";
goto Ending;
CheckDuplication:
##id = dllfunc( "MailIndex" );
call MakeFile;
call GetSearchStr;
if( $$return == "" ){
if( dllfunc( "GetMailFlag", "html" ) )return true;
return false;
}
$$search_str = dllfuncstr( "YenEncode", $$return );
run "md5sum \"" + "duplicate_spam.tmp" + "\" > " + "\"" +
"duplicate_spam.md5" + "\"";
#tmp = dllfunc( "CancelEditMail" );
while( 1 ){
if( !dllfunc( "SetFindPack","(\"" + $$search_str + "\", target
=body ), inmail=0" ) )call Error "検索を設定";
##result = dllfunc( "FindUp" );
if( !##result )break;
call MakeFile;
##x = x;
##y = y;
beginsel;
run "md5sum -c \"" + "duplicate_spam.md5" + "\" > con";
moveto ##x, ##y;
searchdown "OK\n", regular, word;
##result = result;
if( ##result )break;
#tmp = dllfunc( "CancelEditMail" );
}
#tmp = dllfunc( "SetMailIndex", ##id );
return ##result;
MakeFile:
if( !dllfunc( "BeginEditMail" ) )call Error "編集可能に";
if( readonly)readonlyswitch;
if( browsemode )browsemodeswitch;
gofiletop;
replacedown "((\\[a:)?https?://[a-z0-9_\\./%&\\-\\+=\\?]+(\\])?|
(Dear )?[a-z0-9_\\.\\-]+@[a-z0-9_\\.\\-]+|[_-]+\n EMAIL ID:[a-z0-9 ]
+|^[ \t ]+|^[━\\--〓==★☆◆◇□■●○◎\\*・‥…─]{3,}|[ \t ]+
$|^Thanks\n*.+[\n\n\n]*.+ wrote:\n*>.*\n*.+-\n*out me now\n*)", "",
regular, nocasesense;
while( result )finddown;
gofiletop;
replacedown "^\n", "", regular;
while( result )finddown;
if( gettext( 0, 0, 0, 1 ) == "" )return;
gofileend;
if( linelen2 )insert "\n";
saveas "duplicate_spam.tmp", utf8;
return;
GetSearchStr:
##line = 0;
while( 1 ){
$$s = gettext( 0, ##line, 0, ##line + 1 );
if( ascii( rightstr( $$s, 1 ) ) == 0x0A )$$s = leftstr( $$s,
strlen( $$s ) - 1 );
if( ascii( rightstr( $$s, 1 ) ) == 0x0D )$$s = leftstr( $$s,
strlen( $$s ) - 1 );
if( strlen( $$s ) > 10 )return $$s;
if( ##line == linecount )return "";
##line = ##line + 1;
}
ChangeConf:
openreg "CURRENTUSER","Software\\Hidemaruo\\TuruKame\\Config";
#UnreadSwitch = getregnum( "UnreadSwitch" );
#ActivateUnreadSwitch = getregnum( "ActivateUnreadSwitch" );
#AllViewUnreadSwitch = getregnum( "AllViewUnreadSwitch" );
writeregnum "UnreadSwitch", 0xFFFFFFFF;
writeregnum "ActivateUnreadSwitch", 0;
writeregnum "AllViewUnreadSwitch", 0;
closereg;
#tmp = dllfunc( "EnvChanged" );
$folder = dllfuncstr( "CurrentFolder" );
$s = dllfuncstr( "GetFindPack" );
$s2 = searchbuffer;
#s2 = searchoption;
$r2 = replacebuffer;
#head = dllfunc( "HeaderView" );
#view = dllfunc( "IsThreadView" );
#tmp = dllfunc( "DisableDraw" , 1);
#tmp = dllfunc( "SetThreadView", 0 );
#tmp = dllfunc( "SwitchHeaderView", 0 );
return;
|
|