่ชญ่€…ใงใ™ ่ชญ่€…ใ‚’ใ‚„ใ‚ใ‚‹ ่ชญ่€…ใซใชใ‚‹ ่ชญ่€…ใซใชใ‚‹

AppleScript ใ‹ใ‚‰ iTerm ใซใ‚ณใƒžใƒณใƒ‰ใ‚’้€ใ‚‹

ใ‚ˆใๅฟ˜ใ‚Œใ‚‹ใฎใงใƒกใƒขใ€‚launch session ใงๆ–ฐใ—ใ„ใ‚ปใƒƒใ‚ทใƒงใƒณ๏ผˆใ‚ฟใƒ–๏ผ‰ใ‚’้–‹ใ„ใฆ tell last session ๅ†…ใงๅ‡ฆ็†ใ‚’่กŒใ†ใ€‚

set cmd to "cd /tmp"

tell application "iTerm"
    make new terminal
    tell current terminal
        launch session "Default"
        tell last session
            write text cmd
        end tell
    end tell
end tell

ไธ€ๆ™‚ใƒ•ใ‚กใ‚คใƒซไฝœๆˆใ—ใฆ open ใงใ‚‚ใ„ใ„ใ‚“ใ ใ‘ใฉใ€‚

AppleScript: The Definitive Guide: Scripting and Automating Your Mac

AppleScript: The Definitive Guide: Scripting and Automating Your Mac