Skip to content

Instantly share code, notes, and snippets.

@rok-git
Created February 5, 2018 06:10
Show Gist options
  • Save rok-git/2e4cf88d04ad7b2dbd9cfd77a5483bcf to your computer and use it in GitHub Desktop.
Save rok-git/2e4cf88d04ad7b2dbd9cfd77a5483bcf to your computer and use it in GitHub Desktop.
Finder で新規のウィンドウを開いて、複数のフォルダをそのウィンドウのタブで開く。
set targetList to {"/Users/rok/tmp/", "/Users/rok/work/"}
tell application "Finder"
activate
set tabCount to count targetList
if tabCount ≥ 1 then
open (item 1 of targetList) as POSIX file
tell front window
repeat with i from 2 to tabCount
tell application "System Events" to keystroke "t" using {command down}
set target to (item i of targetList) as POSIX file
end repeat
tell application "System Events" to keystroke "]" using {shift down, command down}
end tell
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment