Sublime Forum

How to run a external process?

#1

Hi,
Anybody know how to use the exec command ? Tell me how to use it please, thanks!
I want to preview my file with some program( use the exec command ), but there is no detail document explanation.

0 Likes

#2

I’ve been digging a little and I believe the exec command is run as a key-binding like this:

{ "keys": "ctrl+shift+y"], "command": "exec", "args": {"cmd": "C:\\windows\\system32\\notepad.exe", "$file"]} }

But it doesn’t seem to parse $file (or $file_path or $file_name).

So, alternatively, try creating a **Build **like this (Tools menu, Build System, New Build System…)

{ "cmd": "C:\\Users\\Andrew\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe", "$file"] }
and just change the first part to refer to the app you want to use. (This example is for Windows). But someone might contribute with more precise info :wink:

0 Likes