Sublime Forum

How to run window.run

#1

I got this code from user guide of this package

https://packagecontrol.io/packages/Chain%20of%20Command

In the guide, they mention this line:

window.run_command("chain",{"commands":[["select_all"],["copy"]]})

How to actually run that command/code?

0 Likes

#2

Paste it into Sublime’s console. The one you’ve mentioned won’t do a thing thought as it requires a focus in editor. The second example will. But I don’t think that’s the way this package is supposed to be used. Third example shows the right way.

0 Likes

#3

It’s python code, so you can run it:

  • from the Sublime Text console (View -> Show Console)
  • a plugin
0 Likes