How can I ask for my graphic program to open a terminal window by passing a parameterized command? I'm using Swift for OS X, grateful.
How can I ask for my graphic program to open a terminal window by passing a parameterized command? I'm using Swift for OS X, grateful.
To open any application you can use the open . The -b argument allows you to identify the application through your package, so to open the terminal you can do this:
open -b com.apple.terminal
Now, if you want to run some script after that, I believe (and maybe it's the best option) you'll need to create an executable file and then include it in the above command. For example, if you have a script.sh file, it looks like this:
open -b com.apple.terminal script.sh
Remembering that this file must have the necessary permissions to execute.