2

I want to execute some terminal commands from my AppleScript. I am executing this with in a for loop. The problem is, for each loop I am getting a new window in Terminal. But I want to execute my all commands in a single window. How I can I do this?

My code is like this,

repeat with i from 1 to 5

    tell application "Terminal"
        activate
        set currentTab to do script "date"
    end tell
end repeat

1 Answer 1

3

Try:

set currentTab to do script "date" in window 1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.