とりあえず日記

VIM→秀丸エディタ→VIM→秀丸エディタ→VIM→秀丸エディタ→VIM→秀丸エディタ→VIM→秀丸エディタ→VIM→秀丸エディタ(いまここ🍄)

秀丸エディタでgrowlを使ってみる

秀丸エディタでファイル保存時にGrowlへ通知を行なってみました。

Growl for Windowsは既に導入されているものとして話を進めます。

通知の手順

Growl for Windowsのパッケージに含まれている growlnotify.exe を使用します。

growlnotify.exe  /t:タイトル  メッセージ

(これ)
C:\Program Files\Growl for Windows\growlnotify.exe


アイコン

こちらで公開されているアイコンを使わせて頂きました、ありがとうございます。

大言壮語も吐いてやろう
http://kaneyan.seesaa.net/archives/200801-1.html

マクロの登録方法

自動起動マクロに登録してください。

マクロ

(Github:右上のダウンロードボタンを押してzipを選択)
https://github.com/ohtorii/growl_for_hidemaru

/*Shift-JIS
秀丸エディタでファイル保存時にGrowlへ通知するマクロ。
自動起動マクロ
*[秀丸エディタ]/

$g_path_growlnotify = "C:\\Program Files\\Growl for Windows\\growlnotify.exe";

//アイコンのファイル名
//存在しなければアイコン無しで通知されます。
$g_path_icon = currentmacrodirectory + "\\hidemaru_icon.png";


call Main;
endmacro;

Main:
    if(3 != event){
        //「保存直前と直後」以外
        return false;
    }
    if(1 != geteventparam(0)){
        //「保存直後」以外
        return false;
    }
    $$arg = "\"" + $g_path_growlnotify +
            "\" /t:秀丸エディタ【保存】" +
            " /i:" + "\"" + $g_path_icon + "\"" +
            " " + basename2;
    runex $$arg
        , 0             //sync    0:async 1:sync
        , 0, ""         //stdin   0:none 1:auto 2:file 3:(reserve) 4:all 5:select
        , 0, ""         //stdout  0:none 1:auto 2:file 3:add file  4:new 5:insert 6:replace
        , 0, ""         //stderr  0:none 1:=out 2:file 3:add file  4:new 5:insert 6:replace
        , 0, ""         //folder  0:none 1:current 2:specify 3:(reserve) 4:exe's folder
        , 2             //show    0:auto 1:show 2:hide
        , 1             //nodraw  0:draw 1:no draw
        , 0             //unicode 0:ansi 2:unicode
        ;

    return true;