2
1
I am trying to create a shell script that runs a python simulation programing in 4 terminal windows. I have the script that launches the program four times in four separate terminal windows(total of 5 windows, 4 for the python programs, and one to control the other terminal windows). I want to now create a script that I can run in the control terminal window that closes and kills the programs of the other four terminal windows, but still have the control one open.
What I have so far is something like this
#!/bin/sh
osascript -e 'tell app "Terminal"
do script "killall python"
end tell'
osascript -e 'tell app "Terminal" to quit'
osascript -e 'tell app "Terminal" to open'
The problem is that the last line doesn't work because it closes all the windows including the one the script is executing in. I am not really familiar with shell or apple script so any help would be welcomed. I posted on Stack, but I think this might be a better place for an automation type question. Thanks
I am a total noobie when it comes to apple script and sh scripting can you edit the answer to function code, and for the "insert your code" part I would just killall python then have the rest close all windows – Greg Brown – 2012-09-26T14:18:25.743
You only want to use osascript for AppleScript commands, not ones that can be executed in the shell (killall python). – adayzdone – 2012-09-26T15:10:10.900