Sublime Forum

How to execute a command in from the command line?

#1

I want to use Sublime Text as an external editor for a different program.

For that to happen, I need to be able to advise Sublime Text to search for a string, or something like that. This seems to be possible using the command line utility and the switch

subl --command

For example, I tried

subl --command "sublime.error_message(\"this is an error sent from the command line\")"

The sublime console (C-`) replies to this with

Unable to parse command: sublime.error_message("this is cool")

However, typing this very same command in the console itself works just fine.

So, how can I run a command like that from the command line?

0 Likes