I have a problem starting a UNIX Programm (Csvmidi) from an cocoa app. It should convert a csv file to a midi file which actually works when i run it through the Terminal.
In Terminal it works fine by putting the URL of the UNIX file, the .csv file and .mid file in a row. Like this:
/Users/...../Csvmid </Users/.../test.csv> /Users/.../Melody.mid
-> and automatically the Midi-File changes.
In Windows it worked with an easy code:
Process.Start("Csvmidi.exe", "test.csv Melody.mid");
In swift I tried to make it work with task.Process()
but still it won't work. How can I make it work?
let csvmidiURL = "/Users/.../Csvmidi"
let process = Process()
process.executableURL = URL(fileURLWithPath: csvmidiURL)
process.arguments = [" <" , lblURL.stringValue , "> " , lblMidi.stringValue]
process.terminationHandler = { (process) in
print("\ndidFinish: \(!process.isRunning)")
}
do {
try process.run()
} catch {}
Thanks in advance!