//
//属性のつかない要素、開始タグと終了タグのある要素に限る var moveX, strSelect, staTag, endTag; strSelect = ""; staTag = ""; endTag = staTag.replace( "<", ""); moveX = staTag.length; if ( Editor.IsTextSelected > 0 ) { strSelect = Editor.GetSelectedString; Editor.Delete; //選択した文字列をコピーしたい場合は Editor.Cut にかえる } //現在位置を移動履歴に登録 Editor.MoveHistSet ( ); //タグの挿入 Editor.InsText( staTag + strSelect + endTag + "\r\n"); //選択した文字列がない場合、カーソル移動 if ( strSelect == "" ) { Editor.MoveHistPrev ( ); for ( i=0; i < moveX; i++ ) { Editor.Right(); } }