Tag Info

New answers tagged


You can ask MMA to run the traditional ps,grep,kill,killall "unix" shell commands (using for example the RunProcess and Runcommands). The following is more a "Unix" post than a Mathematica one, but ... : For Unix, OS X sytems To "check if some application is opened" :ps and grep For example to see if the Chrome browser is running : myExternalCommand = ...


On Windows this works: Run["taskkill /im chrome.exe /f"] Run["taskkill /im WolframPlayerPro.exe /f"]


There are many ways to do this on a Mac. For example to open Safari: << "!open -a Safari" To open Safari to a particular file or page: << "!open -a Safari http://mathematica.stackexchange.com/questions/69247/how-to-close-external-app-from-mathematica" Now to close Safari: << "!osascript -e 'tell application \"Safari\" to quit'"


I actually found 3 ways to execute your command with RunProcess (on Unix like systems) : Let's write your command as a string : mycommand = "mdfind -onlyin /some/folder my_string"; but it could be any other command like : mycommand = "ls -la"; Then these 3 inputs are equivalent : RunProcess[StringSplit@mycommand] RunProcess[{$SystemShell, "-c", ...

Top 50 recent answers are included