Skip to content

Instantly share code, notes, and snippets.

@rok-git
Last active February 5, 2018 06:19
Show Gist options
  • Save rok-git/26fabd2441297b95534fedf9a2149eae to your computer and use it in GitHub Desktop.
Save rok-git/26fabd2441297b95534fedf9a2149eae to your computer and use it in GitHub Desktop.
Finder の最前面で開いているウィンドウにあるタブそれぞれが開いているフォルダを POSIX path として得る。
use scripting additions
tell application "Finder"
set targetList to {}
activate
tell front window
repeat
set t to POSIX path of (target as alias)
-- 同じフォルダを開いたタブは存在しない前提……
-- (タブの数を数えられないので……orz)
if {t} is in targetList then exit repeat
set the end of targetList to t
tell application "System Events"
keystroke "]" using {command down, shift down}
end tell
end repeat
end tell
end tell
tell me to activate
targetList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment