Do you want to actually run the Terminal app? Or runs shell scripts like they would be run in the Terminal app? If it’s the latter, you can use the
Processclass, built in to Swift Foundation. If it’s the former, things get more complex. You can launch Terminal and tell it do things via its AppleScript interface. It’s possible to run such scripts programmatically from Swift, but it’s a bit tricky (the code is not too hard, but to write it you’ll need to understand a lot about how various parts of the OS fit together).
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for directing me!
I decided for the Process()-class and it works perfect, as I imagined.
Also I understand in this way, that the terminal "order-files" are stored in
Maybe this helps also Mac newcomers as me.