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