Path Finderから、svn update
2006/04/30 18:05
Finder上でSubversionコマンドを実行出来るSCPluginだが、PathFinder 4.x上で動かすと妙な動作をすることがある。(過去エントリ)
今まで我慢して使っていたけど、既知の不具合をそのまま放置して使い続けるのもどうかと思い、AppleScriptのドロップレットを作ってみた。(以下)
property command : "/usr/local/bin/svn update"
on run
open ({choose folder})
end run
on open (DirectoryList)
repeat with theDirectory in DirectoryList
try
set thePath to POSIX path of theDirectory
set theCommandLine to (command & " " & thePath)
set theResult to (do shell script theCommandLine)
if (theResult /= "") then
displayOKDialog(theCommandLine & return & return & theResult)
end if
on error theErrorMessage
displayOKDialog("Error:" & return & theErrorMessage)
end try
end repeat
end open
on displayOKDialog(theMessage)
display dialog theMessage buttons {"OK"} default button 1
end displayOKDialog
スクリプトエディタを開いて、上のソースを「アプリケーション」形式で保存する。毎度のやっつけ仕事で恐縮だけど。
最初のプロパティを書き換えればsvn以外の外部コマンドにも対応するので、お試しあれ。
それにしても、AppleScriptの文法なんてきれいさっぱり忘れていたよ。
大昔にこいつでCGI書いてた頃は、ほぼ毎日触ってたんだけどねぇ。
