2008-04-08

LaunchBar でのタグ付けが楽しいというお話。


LaunchBar でコメントタグを付ける時 2/19 のポストにある AppleScript を使用していましたが、微妙にバグがありました。


修正版の内容はこんな感じ。




on handle_string(s)

try

set tagString to s

tell application "Finder"

try

set theFiles to selection

repeat with theItem in theFiles

-- Set Label Color On/Off

-- set label index of theItem to 0

-- Set SpotlightComment

set newSptcomString to ""

set sptcomString to comment of theItem

if sptcomString is "" then

set newSptcomString to tagString

else

set newSptcomString to sptcomString & " " & tagString

end if

set comment of theItem to newSptcomString

end repeat

open location "x-launchbar:hide"

on error msg number val

{errMsg:msg, errVal:val}

end try

end tell

end try

end handle_string



MameApp が使用するタグ付け三点セットのうちのひとつ「Hazel」で、フォルダ内で時間が経ったファイルにはカラーラベルが付くというルールを適応させている関係上このスクリプトを使うとカラーラベルが外れます。「set label index of theItem to 0」の前のコメントアウト部分を消せばラベルはそのままになります。

このスクリプトは元々付いているコメントタグはそのままで新しく追加するタイプですが、途中に少し手を加えた上書きタイプも作って一緒に使うと更に便利!

それから今まで CommentCleaner を LaunchBar から起動させて使っていましたが、LaunchBar からだと当然ですがスクリプト保存してそのまま使った方が起動も反映も速いのでした。

ストレスなくタグ付けできるって良いなあとしみじみ実感中。



by. D