[したいこと・しりたいこと・目標]
ファインダーで選択しているフォルダーをターミナルで開く作業をAutomatorで自動化する[環境]
Mac OS X 10.6 Snow Leopard
[したこと]
(01)
Automatorでワークフローを作成する

(02)
コードの内容
on run {input, parameters}
tell application "Terminal"
activate
if (the (count of the window) = 0) or ¬
(the busy of window 1 = true) then
tell application "System Events"
keystroke "n" using command down
end tell
end if
do script "cd \"" & (POSIX path of ¬
(input as string)) & "\"" in window 1
end tell
return input
end run
(03)
作成したワークフローを~/Library/Scripts/Finderに配置する
(04)
AppleScriptエディタのファイルメニューから環境設定を開く
一般タブで、メニューバーにスクリプトメニューを表示するにチェックを入れる
(05)
スクリプトメニューから作成したワークフローを実行
[参考]
10.4: Use Automator to open chosen folder in Terminal - Mac OS X Hintshttp://www.macosxhints.com/article.php?story=20050827164648766
0 件のコメント:
コメントを投稿