- Home /
Run Terminal Command using System.Diagnostics.Process not working on osx
I've been using the following code to run a Terminal command. It opens the terminal but no command is entered. What is the correct way to launch the terminal and send a command to it? The command I want to send is cliclick c:100,100; The command line application is named cliclick, and clicks a mouse.
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cliclick";
process.StartInfo.Arguments = "c:"+x + "," + y;
Debug.Log("c:"+x + "," + y);
//process.StartInfo.CreateNoWindow=true;
process.StartInfo.UseShellExecute=false;
process.Start("/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal");
Debug.Log("Key it PROCESSSTART");
Answer by pranavgadamsetty · Feb 17, 2017 at 08:01 AM
I think the first line should say - "System.Diagnostics.Process process" and not "var process"
Answer by TechDevTom · Jun 30, 2017 at 01:06 PM
dansav, did you ever get this sorted? Did pranavgadamsetty's suggestion work?
Your answer
Follow this Question
Related Questions
Open Terminal window for OSX System.Diagnostics.Process 0 Answers
Run terminal cmd on osx 0 Answers
How to get .exe file to run through script? 1 Answer
How to use Process.Start() with arguments on OSX in an EditorWindow? 3 Answers
Type 'System.Diagnostics.Process' does not contain a definition for 'CloseMainWindow' 1 Answer