Last active
February 5, 2018 06:19
-
-
Save rok-git/26fabd2441297b95534fedf9a2149eae to your computer and use it in GitHub Desktop.
Finder の最前面で開いているウィンドウにあるタブそれぞれが開いているフォルダを POSIX path として得る。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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