Created
August 15, 2023 00:07
-
-
Save csnagu/0f240727a8b8b9c788d8689ce0b31a23 to your computer and use it in GitHub Desktop.
macでコンテキストに応じたデスクトップレイアウトを準備してくれるAppleScript
This file contains 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
tell application "Terminal" | |
activate | |
do script "code ~/path/to/workspace" | |
delay 2 | |
quit | |
end tell | |
arrangeWindow(124) -- 124: right arrow | |
tell application "Google Chrome" | |
make new window | |
activate | |
open location "https://example.com" | |
end tell | |
arrangeWindow(126) -- 126: up arrow | |
delay 2 | |
tell application "Google Chrome" | |
make new window | |
activate | |
open location "https://example.com" | |
end tell | |
arrangeWindow(123) -- 123: left arrow | |
on arrangeWindow(keycode) | |
tell application "System Events" | |
key code keycode using {command down, shift down, option down} | |
end tell | |
end arrangeWindow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment