kitchen800
kitchen800

Reputation: 227

can i run the terminal in the background from applescript

I have an applescript that calls the terminal to run some functions every time my mac wakes up from a sleep. I am getting a bit annoyed of the terminal constantly popping up everytime I open up the laptop. is there a way i can set it so that the terminal can run in the background or in a minimised window and not keep popping up?

My AppleScript is as follows:
set desktop_folder to "$HOME/Desktop"
tell application "Terminal"
    activate
    do script "cd desktop;cd project34;python3 main.py"
end tell

Upvotes: 0

Views: 461

Answers (1)

user3439894
user3439894

Reputation: 7555

You can use this by itself, with out the Terminal block:

do shell script "cd ~/Desktop/project34; python3 main.py"

Note that you may need to include the path to python3.

Upvotes: 1

Related Questions