2008-02-26

LaunchBar + MacNote3 のお話。


 LaunchBar は、検索バーに直接テキストを書き込み、それをテキストエディタ.app の新規ドキュメントとして保存するスクリプトがあります。
これと似たようなことを愛用中の MacNote3 でしたいと思い T に AppleScript を書いてもらいました。
T にお願いする前に一応自分でも参考スクリプトを開きひとしきりディスプレイとにらめっこをしましたが、良く理解出来ず…。自分で書いたものだと未だに Finder と Dashboard の再起動スクリプトくらいしかきちんと成功したことないのです!




そんなわけで早速この MacNote3 用 AppleScript を LaunchBar に登録して使用中。基本的にプレーンテキスト形式でしか書き込み&保存できない仕様なので改行やタグは無視されますが、ちょっとしたメモの走り書き目的には便利でお気に入り。



AppleScript はこんな感じで書かれてます。



on handle_string(s)
try

tell application "MacNote3"
try
set topPages to pages
set lyricsPage to null

repeat with thisPage in topPages
if title of thisPage = "From LaunchBar" then
set lyricsPage to thisPage
end if
end repeat

if lyricsPage = null then
set lyricsPage to add new page title "From LaunchBar"
end if

tell lyricsPage
set newPage to add new page title null content s insert to 0
end tell

show window 1 page newPage

on error msg number val
{errMsg:msg, errVal:val}
end try
end tell

end try
end handle_string



LaunchBar と MacNote3 は便利な使い方を色々考えられそうで楽しみ。


そういえば、今まで私のポストは字ばかりの説明でかなり読みづらかったことに気づきました。これからはなるべく画像も使っていきますよ!なんとなく華やかですし。


by. D

2008-02-19

タグ管理試行錯誤


色々試してなんとなく

  • Finder + スマートフォルダ(タグファイル閲覧)
  • AmCommentCMX(選択ファイルのコンテクストメニューからのスポットライトコメント表示・入力)
  • Butler(ショートカットタグの一覧表示)
  • Hazel(タグ付けしたファイルの自動振り分け等)

でタグ管理をしていたのですが、LaunchBar を使い始めたのでせっかくだから

部分を

にしてみました。
Finder でファイルを選択 → LaunchBar で AppleScript を呼び出し、Butler で作ってあるタグ一覧からタグを選択
でコンテクストメニューからタグ付けするより早くて良い感じ。

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 None
set label index of theItem to 0

-- Set SpotlightComment
set sptcomString to comment of theItem
if sptcomString is "" then
else
set tagString to sptcomString & " " & tagString
end if

set comment of theItem to tagString

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


タグとは直接関係ありませんが… Hazel はすごいですね。これで幸せになれる人は多そうだ。



by.T