Annotation of OpenXM_contrib2/windows/post-msg-asirgui/asirgui.mac, Revision 1.1
1.1 ! takayama 1: // $OpenXM$
! 2: // Keep shift-jis code!
! 3: call Main;
! 4: endmacro;
! 5: Main:
! 6: menu "asirgui起動","編集中のファイルの実行","選択範囲の実行","行の実行","選択範囲の実行(paste)","行の実行(paste)";
! 7: if (result==0) endmacro;
! 8: else if (result == 1) {
! 9: run getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\asirgui";
! 10: } else if (result == 2) {
! 11: run "cmd /c "+getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\cmdasir %f";
! 12: } else if (result == 3) {
! 13: call ExecuteSelectedArea;
! 14: } else if (result == 4) {
! 15: call ExecuteSelectedLine;
! 16: } else if (result == 5) {
! 17: call ExecuteSelectedAreaByPaste;
! 18: } else if (result == 6) {
! 19: call ExecuteSelectedLineByPaste;
! 20: }
! 21: return true;
! 22: ExecuteSelectedArea:
! 23: if(selecting) {
! 24: $s = gettext(seltopx,seltopy,selendx,selendy);
! 25: // message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない.";
! 26: $tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr";
! 27: run "cmd /c del "+$tmp_fname ;
! 28: call MakeFile $tmp_fname,$s;
! 29: run "cmd /c "+getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\cmdasir "+$tmp_fname;
! 30: } else {
! 31: message "範囲選択されていません";
! 32: }
! 33: return true;
! 34: ExecuteSelectedLine:
! 35: golinetop;
! 36: beginsel;
! 37: golineend;
! 38: // message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy));
! 39: call ExecuteSelectedArea;
! 40: return true;
! 41:
! 42: // MakeFile in cmd_perl. See
! 43: // http://d.hatena.ne.jp/ohtorii/
! 44: // https://github.com/ohtorii
! 45:
! 46: MakeFile:
! 47: $$tmp_filename = $$1;
! 48: ##old_charset = charset;
! 49: $$text=$$2;
! 50: ##prev_hidemaru = hidemaruhandle(0);
! 51:
! 52: openfile "/h " + $$tmp_filename;
! 53: if(! result){
! 54: message("テンポラリファイルのオープンに失敗。\n" + $$tmp_filename);
! 55: return false;
! 56: }
! 57: ##new_hidemaru = hidemaruhandle(0);
! 58: setencode ##old_charset,1;
! 59: insert $$text;
! 60:
! 61: save;
! 62: setactivehidemaru ##prev_hidemaru;
! 63: closehidemaruforced ##new_hidemaru;
! 64: return true;
! 65:
! 66: ExecuteSelectedAreaByPaste:
! 67: if(selecting) {
! 68: $s = gettext(seltopx,seltopy,selendx,selendy);
! 69: // message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない.";
! 70: $tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr";
! 71: run "cmd /c del "+$tmp_fname ;
! 72: call MakeFile $tmp_fname,$s;
! 73: run "cmd /c "+getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\cmdasir --paste-contents "+$tmp_fname;
! 74: } else {
! 75: message "範囲選択されていません";
! 76: }
! 77: return true;
! 78: ExecuteSelectedLineByPaste:
! 79: golinetop;
! 80: beginsel;
! 81: golineend;
! 82: // message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy));
! 83: call ExecuteSelectedAreaByPaste;
! 84: return true;
! 85:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>