Trying to execute a command from applescript.
tell application "iTerm 2" make new terminal tell the current terminal activate current session launch session "Default Session" tell the last session write text "cd ~/Downloads; clear; pwd" end tell end tell end tell
Referencing this question: How do I set up an AppleScript to open a new iTerm2 tab and change the directory?
This doesn't seem to work for me. In fact, neither the exec command or the write text commands seem to work - the text is placed on the command line, but the newline isn't added to actually execute it. My suspicion is that it's somehow writing the text before the terminal is ready for input...