0

I have a subroutine which opens a terminal and runs a script.

It looks like this

on run_python()
    tell application "Terminal"
        set currentTab to do script ("cd Desktop/")
        do script ("python3 demo.py") in currentTab
    end tell
end run_python

I'm wondering how to close that terminal tab after running the script. Can you help me?

user9991
  • 53
  • 1
  • 7
  • 1
    Do you really need to run the script in Terminal.app or would `do shell script` be sufficient? And do you mean close the tab/window or quit the app? – vadian Nov 12 '20 at 09:12
  • Yes, I want to run the script in Terminal.app and I just want to close the terminal window opened by the applescript. It should not affect any other terminal windows. – user9991 Nov 12 '20 at 09:51
  • 1
    Does this answer your question? [How to close a Terminal tab using AppleScript?](https://stackoverflow.com/questions/27453987/how-to-close-a-terminal-tab-using-applescript) – RobC Nov 14 '20 at 15:20

0 Answers0