Bridgeで、任意に設定したフォルダをショートカット一発!で開くマクロ #keyboardmaestroをアップデートしましたー!
前verでは登録にもショートカット使ってちょっとムダっぽかったんで……( ‘ㅂ’)
どんなマクロ?
Mac用ユーティリティーKeyboard Maestroで使うマクロです。
※KM記事はこちらに。
事前に登録したフォルダを、キーボードショートカットいっぱつでBridgeで開きます。6個まで当てられますが、とりあえず9個まではちょっといじるだけで対応可能。
またモデファイキーを追加すれば、Finderで開きます。
Bridgeないと仕事できない人なのですが、Bridgeの「お気に入り」パネル展開するのも邪魔だし、フォルダパネルで辿っていくのもしんどいし、ショートカットで一発アクセスできると本当に助かるのです。このマクロは手癖になるほど使ってます!
ダウンロード
こちらからダウンロード、解凍し、

これをダブルクリックするとKeyboard Maestroに登録されます。
使い方
初期設定では
Control + テンキーの1〜6で設定したフォルダをBridgeで、
Control+Shift+テンキーの1〜6でFinderで、
それぞれ設定したフォルダを開きます。
使い始めには、未設定なので上記キーを押しても警告を出します。

というわけでこの通りに。
メニューから上記表記のものを開くと、設定確認&設定画面になります。
どのキー(スロット)にどのフォルダを割り当てたか、こちらから確認できます。もちろん、このウインドウを開くキーをマクロに割り当てることもできます。※Control + テンキーの0を当てていますが、邪魔なら解除してください。

スロットを選択して「変更」ボタンを押し、ファイルダイアログでフォルダを指定してください。

開かない、動作しない、というときはマクロの指定アプリケーション設定などを環境に合わせて見直してみてください。
※ あと、たぶんKM8.1.1以降でないと動かないと思います。
なかみ
登録・確認ウインドウはこれだけです。
変数は先に作っておかないと自動で作ってくれたりしないので、そこらへんで肥大してる感じ…
repeat
BridgeOpenList()
if button returned of result is not "続けて設定" then exit repeat
end repeat
on BridgeOpenList()
tell application "Keyboard Maestro Engine"
set {myDispList, myKey, myDirList, myDir} to {{}, 0, {}, ""}
set myDicName to "BridgeOpenTrigger"
-- ディクショナリが無ければ作成
try
set myDict to dictionary myDicName
on error
set myDict to make new dictionary with properties {name:myDicName}
end try
-- set myDict to dictionary myDicName
repeat with i from 1 to 6 -- 6個以上はここを変更して、呼び出し側でホットキー追加
-- Dictionaryのキーがなければ作成
try
value of dictionary key i of dictionary myDicName
on error
tell myDict to make new dictionary key with properties {name:i, value:"未設定"}
end try
--内容取得して、リスト表示用とディレクトリのリストに
try
set end of myDirList to (value of dictionary key i of dictionary myDicName)
on error
set end of myDirList to " "
end try
set end of myDispList to (i as text) & ":" & item i of myDirList
end repeat
-- リスト表示
try
set myKey to characters 1 thru 1 of ((choose from list of myDispList with prompt "変更するスロットを選択" with title "BridgeOpen" OK button name "変更" cancel button name "何もしない") as text)
set myDefDir to item myKey of myDirList
on error
return
end try
--Finderでフォルダの存在確認、無ければデスクトップを設定
tell application "Finder"
try
POSIX file (item myKey of myDirList)
on error
set myDefDir to POSIX path of (path to desktop)
end try
end tell
--設定フォルダを指定
try
set myDir to POSIX path of (choose folder with prompt "" & myKey & "番にセットするフォルダを選択" default location myDefDir)
set value of dictionary key myKey of dictionary myDicName to myDir
display dialog "スロット" & myKey & "番を、" & myDir & "に変更しました" buttons {"終了", "続けて設定"} default button 1
return result
on error
return
end try
end tell
end BridgeOpenList
呼び出し部分はこんな感じ。

