Sakura-Editor Macro Reference

S_GetSelectxxxの使用例

//sample.js
//カーソル位置の単語のバイト数
SelectWord;
var iLen = GetSelectColmTo - GetSelectColmFrom;

var oWsh = new ActiveXObject("WScript.Shell");
oWsh.Popup(iLen + "byte", 0, "", 0);
//sample.ppa
//選択状態を調べる
if S_IsTextSelected = 0 then
  MessageBox('非選択状態です', 'title', 0)

else if S_IsTextSelected > 1 then
  MessageBox('矩形選択状態です', 'title', 0)

else if (S_GetSelectColmFrom = 1) and (S_GetSelectColmTo = 1) then
  MessageBox('行選択状態です', 'title', 0)

else if S_GetSelectLineFrom = S_GetSelectLineTo then
  MessageBox('1行以内の部分選択です', 'title', 0)

else
  MessageBox('複数行にまたがった部分選択です', 'title', 0)
;