Sublime Forum

[SOLVED] I can't get my macro to work

#1

I have been trying to create a macro in which one of the commands is to move the current file to group 1.

I took out the rest of the macro and left only the move_to_group command in and it still doesn’t seem to work, although if I use the same command in a key binding it works fine.

This is my macro file:

{ "command": "move_to_group", "args": { "group": 1 } } ]

Is this ok or does move_to_group just not work in macros?

0 Likes

#2

I’ve found a solution.

It seems that move_to_group isn’t a valid command for a macro or something like that so I found out how to run commands via a plugin.

This is what I wanted to do:

[code]import sublime, sublime_plugin

class PyReplCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.run_command(‘run_existing_window_command’, {
‘id’: ‘repl_python_run’,
‘file’: ‘config/Python/Main.sublime-menu’
})

    sublime.active_window().run_command('move_to_group', {
        'group': 1
    })[/code]
0 Likes