2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Finderで選択しているフォルダ・ファイルを2022以降のAdobe Bridgeに開かせるAppleScript

Last updated at Posted at 2024-03-23

Keyboard Maestroで実行させたり、スクリプトエディタでアプリケーションにしてFinderウインドウのツールバーに置いてもよいですね。

Bridgeが本当にAppleScript非対応になってしまったため、従来の
・選択したファイルを、Bridgeウインドウ内で選択状態で開く
という動作ができなくなりました。

いや実際にはできるんですが、jsxなどを渡すとBridgeが開こうとしやがるので、しょうがなく上位フォルダを開かせるに留めています。

まぁ無いとあるとでは大違いなんで、使ってみてください。

OpenBridge.scpt
(*
Finderの選択アイテムをBridgeで開くスクリプト
2025/3 Version 12
*)

-- Bridge2024以前はidにバージョン番号が付くので書き換える
set DefBridge to application id "com.adobe.bridge"

-- System Eventsやshell用に名前を抽出
set nameBridge to name of DefBridge

--Bridge起動チェック
tell DefBridge to activate
tell application "System Events"
	
	--起動していない場合5秒待機
	repeat 50 times
		if exists application process nameBridge then exit repeat
		delay 0.1
	end repeat
	
	--一応起動しているかチェックして、新規ウインドウを開く
	if exists application process nameBridge then
		tell process nameBridge
			reopen
			try
				click menu item 1 of menu 1 of menu bar item 3 of menu bar 1
			end try
		end tell
	end if
end tell

--Finderselection判定してセット
tell application "Finder"
	set mySel to selection
	if mySel is {} then
		--開いてるフォルダ、閉じている時はデスクトップ
		set myPATH to insertion location as alias
	else
		--複数選択しているときは最初のもの
		set myPATH to item 1 of mySel as alias
		--エイリアスを解決
		try
			set myPATH to original item of myPATH as alias
		end try
		
		--ファイルの際には上位フォルダを選択
		if kind of (info for myPATH) is not "フォルダ" then
			set myPATH to container of myPATH as alias
		end if
		
	end if
end tell

--FinderやDockでアイコンに放り込んだときと同じ動作にする
set myPATH to POSIX path of myPATH
do shell script "open -a " & quoted form of nameBridge & " " & quoted form of myPATH
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?