masterial
masterial

Reputation: 2216

How do I run two shell scripts in two terminal windows using Applescript?

I can't figure out the Applescript code to run two different shell scripts in two windows.

What I got so far is...

set s1 to "echo A"
set s2 to "echo A"
tell application "Terminal"
    activate
    tell window 0
        set visible to true
    end tell
    set shell to do script s1 in window 0
    tell window 1
        set visible to true
    end tell
    set shell to do script s2 in window 1
end tell

But this displays everything in one window. This is pissing me off, please help!

Upvotes: 0

Views: 530

Answers (1)

Lri
Lri

Reputation: 27633

Doesn't do script open a new window by default?

tell application "Terminal"
    activate
    do script "echo A"
    do script "echo A"
end tell

Upvotes: 1

Related Questions