日経新聞の社説をGET

投稿者: okita1 声8 投稿

削除
削除
関連キーワードがない日は文章が消えていました。 やり直し。
editor.newFile(); OutputBar.clear(); OutputBar.Visible = true; OutputBar.writeln("日経新聞データ取得中..."); Redraw = false; var http = new ActiveXObject("Microsoft.XMLHTTP"); http.open("GET", "https://www.nikkei.com/news/editorial/", false); http.onreadystatechange = function() { if (http.readyState != 4) return; document.write(http.responseText); } http.send(null); document.selection.StartOfDocument(); //検索オプション nFlags = eeFindNext|eeFindReplaceQuiet; //社説を探す if (document.selection.Find("

社説

", nFlags)) { document.selection.CharRight(); //最初に見つかったリンクをGET if (document.selection.Find("<a href="",nFlags)) { xPos = document.selection.GetActivePointX(eePosLogicalA); yPos = document.selection.GetActivePointY(eePosLogical); if (document.selection.Find("" class=",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); //社説へのリンクを保存 var strSyasetu = document.selection.Text; //春秋を探す document.selection.StartOfDocument(); document.selection.Find("

春秋

", nFlags); document.selection.CharRight(); document.selection.Find("<a href="",nFlags); xPos = document.selection.GetActivePointX(eePosLogicalA); yPos = document.selection.GetActivePointY(eePosLogical); document.selection.Find("" class=",nFlags); document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); var strSyunju = document.selection.Text; OutputBar.writeln("社説データ取得中..."); http.open("GET", "https://www.nikkei.com" + strSyasetu, false); var xSyunju; var ySyunju; http.onreadystatechange = function() { if (http.readyState != 4) return; document.selection.SelectAll(); document.selection.Delete(); document.write(http.responseText); Trim_Data(1,1); document.selection.EndOfDocument(); xSyunju = document.selection.GetActivePointX(eePosLogicalA); ySyunju = document.selection.GetActivePointY(eePosLogical); } } } } //春秋をGET http.send(null); OutputBar.writeln("春秋データ取得中..."); http.open("GET", "https://www.nikkei.com" + strSyunju, false); http.onreadystatechange = function() { if (http.readyState != 4) return; document.write(http.responseText); Trim_Data(xSyunju,ySyunju); } http.send(null); OutputBar.Visible = false; document.selection.StartOfDocument(); Redraw=true; //トリミング function Trim_Data(xStart,yStart) { var nFlags = eeFindNext|eeFindReplaceQuiet; document.selection.StartOfDocument(); document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.Find("
",nFlags); document.selection.CharRight(); var xEnd = document.selection.GetActivePointX(eePosLogicalA); var yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); document.selection.CharRight(true); document.selection.Delete(); document.selection.Find("

【PR】

",nFlags); document.selection.CharLeft(); var xPos = document.selection.GetActivePointX(eePosLogicalA); var yPos = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.EndOfDocument(true); document.selection.Delete(); document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.EndOfDocument(true); document.selection.CharRight(true); document.selection.Replace(">",">",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace(" ","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("|]*>","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("_nk.formevent(.*?);","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("_nk.fontsize(.*?);","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("_nkconf.?(.*?);","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("t","",eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^ ..*$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^n","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^小サイズに変更.*?印刷$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); }
読売新聞の社説と編集手帳をGETします。 なんでかしらないけどCODEタグの中に書いた「&gt;」が「>」に変換されてしまいます。
//読売新聞の社説と編集手帳をGET editor.newFile(); OutputBar.clear(); OutputBar.Visible = true; OutputBar.writeln("読売新聞データ取得中..."); Redraw = false; var http = new ActiveXObject("Msxml2.XMLHTTP.6.0"); http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { To_sjis(http.responseBody); } } http.open("GET", "https://www.yomiuri.co.jp/editorial/", false); http.send(null); document.selection.StartOfDocument(); //検索オプション nFlags = eeFindNext|eeFindReplaceQuiet; //社説を探す if (document.selection.Find("

社説

", nFlags)) { document.selection.CharRight(); //最初に見つかったリンクをGET if (document.selection.Find("",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); //社説へのリンクを保存 var strSyasetu = "https://www.yomiuri.co.jp/editorial/news/" + document.selection.Text; //編集手帳を探す document.selection.StartOfDocument(); document.selection.Find("/editorial/column1/", nFlags); document.selection.StartOfLine(); document.selection.Find("",nFlags); document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); var strSyunju = "https://www.yomiuri.co.jp" + document.selection.Text; var xSyunju; var ySyunju; OutputBar.writeln("社説データ取得中..."); ss = new ActiveXObject("Msxml2.XMLHTTP.6.0"); ss.onreadystatechange = function() { if (ss.readyState == 4 && ss.status == 200) { document.selection.SelectAll(); document.selection.Delete(); To_sjis(ss.responseBody); Trim_Data(1,1); document.selection.EndOfDocument(); document.selection.NewLine(); xSyunju = document.selection.GetActivePointX(eePosLogicalA); ySyunju = document.selection.GetActivePointY(eePosLogical); } } ss.open("GET", strSyasetu, false); ss.send(null); } } //編集手帳をGET OutputBar.writeln("編集手帳取得中..."); ht = new ActiveXObject("Msxml2.XMLHTTP.6.0"); ht.onreadystatechange = function() { if (ht.readyState == 4 && ht.status == 200) { To_sjis(ht.responseBody); Trim_Data(xSyunju,ySyunju); } } ht.open("GET", strSyunju, false); ht.send(null); } OutputBar.Visible = false; document.selection.StartOfDocument(); Redraw=true; //コード変換 function To_sjis(responseBody) { var st = new ActiveXObject("ADODB.Stream"); st.Type = 1; //バイナリ指定 st.Open(); st.Write(responseBody); st.Position = 0; //ポジション st.Type = 2; //テキスト st.charset = "shift_jis"; document.write(st.ReadText(-1)); st.Close(); } //トリミング function Trim_Data(xStart,yStart) { //本文から前を削除 var nFlags = eeFindNext|eeFindReplaceQuiet; document.selection.StartOfDocument(); document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.Find("",nFlags); document.selection.CharRight(); var xEnd = document.selection.GetActivePointX(eePosLogicalA); var yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); document.selection.CharRight(true); document.selection.Delete(); //本文から後ろを削除 document.selection.Find("",nFlags); document.selection.CharLeft(); var xPos = document.selection.GetActivePointX(eePosLogicalA); var yPos = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.EndOfDocument(true); document.selection.Delete(); //タグや空白を削除 document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.EndOfDocument(true); document.selection.CharRight(true); document.selection.Replace(">",">",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace(" ","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("|]*>","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("t","",eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^ ..*$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^n","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); }
日付を取り込むように修正
//毎日新聞の社説と余録をGET editor.newFile(); OutputBar.clear(); OutputBar.Visible = true; OutputBar.writeln("毎日新聞社説取得中..."); Redraw = false; var http = new ActiveXObject("Msxml2.XMLHTTP.6.0"); http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { BinaryToText(http.responseBody,"utf-8"); } } http.open("GET", "https://mainichi.jp/select/opinion/editorial/", false); http.send(""); //社説のアドレスを検索 var nFlags = eeFindNext|eeFindReplaceQuiet; document.selection.StartOfDocument(); if (document.selection.Find("

",nFlags)) { document.selection.CharLeft(); //最初に見つかったリンクをGET if (document.selection.Find("社説:",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); OutputBar.writeln("社説データ取得中..."); ss = new ActiveXObject("Msxml2.XMLHTTP.6.0"); ss.onreadystatechange = function() { if (ss.readyState == 4 && ss.status == 200) { document.selection.SelectAll(); document.selection.Delete(); BinaryToText(ss.responseBody,"utf-8"); } } ss.open("GET", "https://mainichi.jp/select/opinion/editorial/news/" + document.selection.Text, false); ss.send(""); //先頭削除 Trim_Data("","

"); //関連記事削除 Trim_Data("
","
"); //末尾削除 Trim_Data("",""); //タグ削除 DeleteTags(1,1); } } } //余録をGET document.selection.EndOfDocument(); document.selection.NewLine(); var xPos = document.selection.GetActivePointX(eePosLogicalA); var yPos = document.selection.GetActivePointY(eePosLogical); OutputBar.writeln("余録取得中..."); var col = new ActiveXObject("Msxml2.XMLHTTP.6.0"); col.onreadystatechange = function() { if (col.readyState == 4 && col.status == 200) { BinaryToText(col.responseBody,"utf-8"); } } col.open("GET", "https://mainichi.jp/select/opinion/yoroku/", false); col.send(""); //HTMLの先頭から本文の前まで削除 Trim_Data("","

"); //関連記事削除 Trim_Data("
","
"); //本文の終わりから最後まで削除 Trim_Data("",""); //タグ削除 DeleteTags(xPos,yPos); OutputBar.Visible = false; document.selection.StartOfDocument(); Redraw=true; //コード変換 function BinaryToText(responseBody,strCharset) { var st = new ActiveXObject("ADODB.Stream"); st.Type = 1; //バイナリ指定 st.Open(); st.Write(responseBody); st.Position = 0; //ポジション st.Type = 2; //テキスト st.charset = strCharset; document.write(st.ReadText(-1)); st.Close(); } //トリミング function Trim_Data(strStart,strEnd) { var nFlags = eeFindNext|eeFindReplaceQuiet; //削除開始位置を設定 document.selection.StartOfDocument(); if (strStart.length > 0) { if (document.selection.Find(strStart,nFlags)) { document.selection.CharLeft(); } else { return; } } var xStart = document.selection.GetActivePointX(eePosLogicalA); var yStart = document.selection.GetActivePointY(eePosLogical); //削除終了位置を設定 if (strEnd.length == 0) { document.selection.EndOfDocument(); } else { if (document.selection.Find(strEnd,nFlags)) { document.selection.Collapse(); document.selection.CharLeft(); } else { return; } } var xEnd = document.selection.GetActivePointX(eePosLogicalA); var yEnd = document.selection.GetActivePointY(eePosLogical); //削除 document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); document.selection.CharRight(true); document.selection.Delete(); } //タグや空白を削除 function DeleteTags(xStart,yStart) { document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.EndOfDocument(true); document.selection.CharRight(true); document.selection.Replace(">",">",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace(" ","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("|]*>","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("t","",eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^ ..*$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^n","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); }

アサヒ・コムから朝日新聞デジタルに変わったので修正
//朝日新聞の社説と天声人語をGET editor.newFile(); OutputBar.clear(); OutputBar.Visible = true; OutputBar.writeln("朝日新聞社説取得中..."); Redraw = false; var http = new ActiveXObject("Msxml2.XMLHTTP.6.0"); http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { BinaryToText(http.responseBody,"euc-jp"); } } http.open("GET", "https://www.asahi.com/paper/editorial.html", false); http.send(""); //先頭から社説1の前まで削除 Trim_Data("","

"); document.write("#社説1n"); //社説1の終わりから社説2の前まで削除 Trim_Data("検索フォーム","

"); document.write("#社説2n"); //社説2の終わりから最後まで削除 Trim_Data("検索フォーム",""); //タグ削除 DeleteTags(1,1); //天声人語をGET document.selection.EndOfDocument(); document.write("n#天声人語n"); var xPos = document.selection.GetActivePointX(eePosLogicalA); var yPos = document.selection.GetActivePointY(eePosLogical); OutputBar.writeln("天声人語取得中..."); var tj = new ActiveXObject("Msxml2.XMLHTTP.6.0"); tj.onreadystatechange = function() { if (tj.readyState == 4 && tj.status == 200) { BinaryToText(tj.responseBody,"euc-jp"); } } tj.open("GET", "https://www.asahi.com/paper/column.html", false); tj.send(""); //HTMLの先頭から本文の前まで削除 Trim_Data("","

印刷"); //本文の終わりから最後まで削除 Trim_Data("朝日新聞デジタルトップへ",""); //タグ削除 DeleteTags(xPos,yPos); OutputBar.Visible = false; document.selection.StartOfDocument(); Redraw=true; //コード変換 function BinaryToText(responseBody,strCharset) { var st = new ActiveXObject("ADODB.Stream"); st.Type = 1; //バイナリ指定 st.Open(); st.Write(responseBody); st.Position = 0; //ポジション st.Type = 2; //テキスト st.charset = strCharset; document.write(st.ReadText(-1)); st.Close(); } //トリミング function Trim_Data(strStart,strEnd) { var nFlags = eeFindNext|eeFindReplaceQuiet; //削除開始位置を設定 document.selection.StartOfDocument(); if (strStart.length > 0) { if (document.selection.Find(strStart,nFlags)) { document.selection.CharLeft(); } else { return; } } var xStart = document.selection.GetActivePointX(eePosLogicalA); var yStart = document.selection.GetActivePointY(eePosLogical); //削除終了位置を設定 if (strEnd.length == 0) { document.selection.EndOfDocument(); } else { if (document.selection.Find(strEnd,nFlags)) { document.selection.Collapse(); document.selection.CharLeft(); } else { return; } } var xEnd = document.selection.GetActivePointX(eePosLogicalA); var yEnd = document.selection.GetActivePointY(eePosLogical); //削除 document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); document.selection.CharRight(true); document.selection.Delete(); } //タグや空白を削除 function DeleteTags(xStart,yStart) { document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.EndOfDocument(true); document.selection.CharRight(true); document.selection.Replace(">",">",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace(" ","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("|]*>","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("t","",eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^ ..*$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^n","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); }

//産経ニュースの主張と産経抄をGET editor.newFile(); OutputBar.clear(); OutputBar.Visible = true; OutputBar.writeln("産経ニュース取得中..."); Redraw = false; var http = new ActiveXObject("Msxml2.XMLHTTP.6.0"); http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { BinaryToText(http.responseBody,"utf-8"); } } http.open("GET", "https://sankei.jp.msn.com/column/topicslist/column-t.htm", false); http.send(""); //社説のアドレスを検索 var nFlags = eeFindNext|eeFindReplaceQuiet; var strURL = "https://sankei.jp.msn.com/column/topicslist/"; var strADR1 = ""; var strADR2 = ""; document.selection.StartOfDocument(); if (document.selection.Find("

主張

..*">もっと読む",nFlags | eeFindReplaceRegExp)) { document.selection.CharRight(); //最初に見つかったリンクをGET if (document.selection.Find("【主張】",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); strADR1 = strURL + document.selection.Text; //産経抄のアドレス検索 document.selection.StartOfDocument(); if (document.selection.Find("

産経抄

..*">もっと読む",nFlags | eeFindReplaceRegExp)) { document.selection.CharRight(); //最初に見つかったリンクをGET if (document.selection.Find("【産経抄】",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); strADR2 = strURL + document.selection.Text; } } } OutputBar.writeln("社説データ取得中..."); ss = new ActiveXObject("Msxml2.XMLHTTP.6.0"); ss.onreadystatechange = function() { if (ss.readyState == 4 && ss.status == 200) { document.selection.SelectAll(); document.selection.Delete(); BinaryToText(ss.responseBody,"utf-8"); } } ss.open("GET", strADR1, false); ss.send(""); document.selection.StartOfDocument(); //先頭削除 Trim_Data("","
"); //「次のページ」表示が見つかった場合 if (document.selection.Find("
",nFlags)) { document.selection.CharRight(); if (document.selection.Find("2",nFlags)) { document.selection.CharLeft(); xEnd = document.selection.GetActivePointX(eePosLogicalA); yEnd = document.selection.GetActivePointY(eePosLogical); document.selection.SetActivePoint(eePosLogicalA,xPos,yPos); document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); } } strADR1 = strURL + document.selection.Text; OutputBar.writeln("社説データ2ページ目取得中..."); ss2 = new ActiveXObject("Msxml2.XMLHTTP.6.0"); ss2.onreadystatechange = function() { if (ss2.readyState == 4 && ss2.status == 200) { document.selection.SelectAll(); document.selection.Delete(); BinaryToText(ss2.responseBody,"utf-8"); } } http.open("GET", strADR1, false); http.send(""); document.selection.StartOfDocument(); //1ページ目末尾から2ページ目先頭まで削除 Trim_Data("
","
"); //「次のページ」表示削除 Trim_Data("
","
  • 次のページ >
  • "); } //末尾削除 Trim_Data("",""); //タグ削除 DeleteTags(1,1); document.selection.StartOfDocument(); document.write("産経ニュース【主張】n"); } } } //産経抄をGET document.selection.EndOfDocument(); document.write("n【産経抄】n"); var xPos = document.selection.GetActivePointX(eePosLogicalA); var yPos = document.selection.GetActivePointY(eePosLogical); OutputBar.writeln("産経抄取得中..."); var col = new ActiveXObject("Msxml2.XMLHTTP.6.0"); col.onreadystatechange = function() { if (col.readyState == 4 && col.status == 200) { BinaryToText(col.responseBody,"utf-8"); } } col.open("GET", strADR2, false); col.send(""); //HTMLの先頭から本文の前まで削除 Trim_Data("","
    "); //本文の終わりから最後まで削除 Trim_Data("",""); //タグ削除 DeleteTags(xPos,yPos); OutputBar.Visible = false; document.selection.StartOfDocument(); Redraw=true; //コード変換 function BinaryToText(responseBody,strCharset) { var st = new ActiveXObject("ADODB.Stream"); st.Type = 1; //バイナリ指定 st.Open(); st.Write(responseBody); st.Position = 0; //ポジション st.Type = 2; //テキスト st.charset = strCharset; document.write(st.ReadText(-1)); st.Close(); } //トリミング function Trim_Data(strStart,strEnd) { var nFlags = eeFindNext|eeFindReplaceQuiet; //削除開始位置を設定 document.selection.StartOfDocument(); if (strStart.length > 0) { if (document.selection.Find(strStart,nFlags)) { document.selection.CharLeft(); } else { return; } } var xStart = document.selection.GetActivePointX(eePosLogicalA); var yStart = document.selection.GetActivePointY(eePosLogical); //削除終了位置を設定 if (strEnd.length == 0) { document.selection.EndOfDocument(); } else { if (document.selection.Find(strEnd,nFlags)) { document.selection.Collapse(); document.selection.CharLeft(); } else { return; } } var xEnd = document.selection.GetActivePointX(eePosLogicalA); var yEnd = document.selection.GetActivePointY(eePosLogical); //削除 document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true); document.selection.CharRight(true); document.selection.Delete(); } //タグや空白を削除 function DeleteTags(xStart,yStart) { document.selection.SetActivePoint(eePosLogicalA,xStart,yStart); document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart); document.selection.EndOfDocument(true); document.selection.CharRight(true); document.selection.Replace("<","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace(" ","",eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("|]*>","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("t","",eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^ ..*$","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); document.selection.Replace("^n","",eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly); }
    マクロを1つにまとめてPOPUPメニューから選択するようにしたのですが、大きくなりすぎたのでライブラリに登録しました。

    このトピックの投稿: 8