-- Finder ウインドウに開いているフォルダを Terminal で開く (cd) tell application "Finder" try close (every window whose floating is true) if collapsed of the front window then error set theFldr to folder of the front window if (kind of theFldr) is not "フォルダ" then set theFldr to folder of theFldr -- ↑カラム表示でファイルがひとつだけ選択されてる時、 --  なぜかそのファイル自身がアクティブフォルダ扱いになってる事への対処。 on error set theFldr to path to desktop folder end try end tell tell application "Terminal" activate do script "cd " & quoted form of POSIX path of (theFldr as alias) end tell