0

I am trying to fire multiple iTerm2 tabs vertically and I get an error.

Here is the script I am running:

#/bin/bash

tell application "iTerm2"
    tell current session of current tab of current window
        write text "ssh host"
        repeat 1 times
          split vertically with default profile
        end repeat
    end tell
    tell second session of current tab of current window
        write text "ssh host"
    end tell
end tell

I am getting the following error:

./iterm2.sh: line 3: tell: command not found
./iterm2.sh: line 4: tell: command not found
write: text is not logged in on ssh host
./iterm2.sh: line 6: repeat: command not found
split: vertically: No such file or directory
./iterm2.sh: line 8: end: command not found
./iterm2.sh: line 9: end: command not found
./iterm2.sh: line 10: tell: command not found
write: text is not logged in on ssh host
./iterm2.sh: line 12: end: command not found
./iterm2.sh: line 13: end: command not found
1
  • What is tell supposed to be? Commented Oct 6, 2021 at 17:02

1 Answer 1

2

This is an AppleScript, not a bash one.

Change the she-bang to:

#!/usr/bin/osascript
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.