Sublime Forum

External scripting?

#1

Hi,

Is it possible to script Sublime Text (3) externally? That is control ST3 from an external, say Python script?

I’m looking for functions like get a list of windows, list of views, open/close window, discover unsaved buffers, save a buffer, save as, etc . I currently do with with a number of apps using AppleScript to set up my environment but ST has escaped me so far.

I know of the internal API, but not how to invoke it from an external script. http://www.sublimetext.com/docs/3/api_reference.html

It may be that some hack is possible, i.e. long running proxy inside ST. If anyone has any ideas or examples of stuff like that I’d love to know

Thanks!
Toby

0 Likes

#2

Haven’t used it before but perhaps sublimetext.com/docs/2/osx_ … _line.html would be useful. Specifically the “–command” flag.

0 Likes

#3

Thanks, I’ll take a look. I use subl often, but hadn’t seen the --command option.

0 Likes