Tag Info

Hot answers tagged

7

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'"


6

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


5

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 = ...


2

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", ...



Only top voted, non community-wiki answers of a minimum length are eligible